Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid column format 1

Status
Not open for further replies.

naitx

Programmer
Apr 18, 2008
10
PH

Hi,


How can I format Datagrid Column into percentage?

Datagrid.Columns("fieldname").DataFormat = ???


Thanks in Advance
 
To use the .DataFormat you need to first define a StdDataFormat object and set the .DataFormat to it.

Form simple formating, an easier method would be to use the NumberFormat property.
With this you can define formats the same as you would with the Format$() function:

'Percent:
DataGrid.Columns("SomeNumericField").NumberFormat = "Percent"

'Upper case:
DataGrid.Columns("SomeTextField").NumberFormat = ">"

'Date
DataGrid.Columns("SomeDateField").NumberFormat = "yyyy-mm-dd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top