This is a migrated thread and some comments may be shown as answers.

Formating Grid column

1 Answer 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ganesh Kumar Sathiyamoorthy
Top achievements
Rank 1
Ganesh Kumar Sathiyamoorthy asked on 19 Oct 2010, 09:57 PM
Hi,

I am using following code for fomating one of the grid column.

 

Private Sub Grid_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles WITSGrid.ColumnCreated

 

 

 

 

If InStr(e.Column.UniqueName, "USD", CompareMethod.Binary) > 1 Then

 

e.Column.ItemStyle.HorizontalAlign = HorizontalAlign.Right

 

Dim x As GridBoundColumn = CType(e.Column, GridBoundColumn)

 

x.DataFormatString =

"{0:###,###.###}"

 

 

End If

 

 

 

 

 

End Sub

problem is when that column has 0 values then it is displaying as null vall (empty cell) insted of 0.000. Can you please suggest me.

Regards
admin

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 22 Oct 2010, 01:14 PM
Hi Ganesh,

Our system indicates that you have posted identical questions in the forums and in our support system. I am closing this thread in order to avoid duplicate posts. If you have any questions regarding this matter, please, post them in the support ticket.

Additionally, I am posting the offered solution here as well, for other users to see. The desired format of ###,###.### can be achieved by using the standard .NET numeric format strings, more specifically {0:N3}.

Greetings,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Ganesh Kumar Sathiyamoorthy
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or