Format properity in a DataGridTextBoxColumn

jvcoach23

Well-known member
Joined
May 22, 2003
Messages
192
Location
Saybrook, IL
I thought I posted this message yesterday but I can find it so Illl reenter it. If it is a second post, my appoligies.

Im trying to use some code I found on this site to format a DataGRidTextBoxColumn.

Dim objCPUTime As New DataGridTextBoxColumn
With objCPUTime
adjust width and alignment
.MappingName = "CPUTime"
.HeaderText = "CPU Time"
set the width of the column
.Width = 60
set the alignment within the column
.Alignment = HorizontalAlignment.Left
.Format = "c" << set the column to currency
End With

I cant get the .Format = "c" to work. As I understand it, the "c" should force the data to be formatted as currency value. The result that is coming back is still an integer. The HeaderText is correct, so I believe part of the DataGridTextBoxColumn is working when I added the GridColumnStyles.AddRange to it. Can some point out what Im doing wrong in the .Format syntax.

Thanks
SHannon
 
Back
Top