Have you tried setting the format at design time? Just go into the Datagrid properties window, select the Format tab, and select the column from the dropdown and the format from the box.
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
Don't see why it should. "NumberFormat" accepts the same format strings as the Format statement and this one specifies two digits after the decimal place so '2.30' should be formatted as '$2.30' and '2.70' will be '$2.70'.
You are correct however ... you can use "Currency" in place of the explicit format string.
awinnn
I don't understand what difference it makes how you are getting your data - it's the DataGrid properties you need to change.
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
Hi all,
thanx for reply,
this is what i've got,
------------------------------------------------------
Dim fmtCurrency As New StdDataFormat, c As Column
fmtCurrency.Format = "Currency"
For Each c In DataGrid1.Columns
If c.ColIndex = 1 Then Set c.DataFormat = fmtCurrency
If c.ColIndex = 3 Then Set c.DataFormat = fmtCurrency
Next
------------------------------------------------------
For the property pages of a DataGrid, rightclick on the Grid when viewing the form in design view. The right hand tab is labelled Format
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'People who live in windowed environments shouldn't cast pointers.'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.