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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Datagridview column

Status
Not open for further replies.

azrobert

Programmer
Apr 27, 2002
393
US
I am using a datatable pulled from an access database as the datasource for a datagridview.

I have been using:

Me.DataGridView1.Columns
"CurrentValue").DefaultCellStyle.Format = "C"

to format the columns in datagridviews and it works fine if the datasource is a dataset, it does not seem to work on the datagrid view with the source from a datatable.....

any ideas ?
 
Does the datatable have a string type for a corresponding column? If so I believe the formatting won't apply.

You could try setting it to a decimal before populating it.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top