Reputation: 735
I got this problem trying to format the values of a specific column but gives me error Object doesn't support this property of method
. How can I fix this issue?
Here is my code:
Set dgData.DataSource = rs
dgData.Columns(1).DataFormat = "#,##0.00"
Upvotes: 1
Views: 4685
Reputation: 695
Try this code
Dim d As Integer
For i as Integer = 0 to dgData.Rows.Count -1
d = CInt(dgData.Rows(i).Cells(1).ToString
d.ToString("#,##0.00")
dgData.Rows(i).Cells(1).Value = d
Next
Upvotes: 1