Datagrid
-
Hi Everyone, Is it possible to have thousand seperators and currency format in a datagrid. Can anyone help me in this regard.
Regards, Manowj
Yes, just define them in your column definitions for the grid, by using ToString on the data items you're showing with a formt string.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Hi Everyone, Is it possible to have thousand seperators and currency format in a datagrid. Can anyone help me in this regard.
Regards, Manowj
Paste below function into .VB file
Function IndiaRupees(ByVal rs As String) Dim str As String = "" str = Right(rs, 3) rs = Left(rs, IIf(rs.Length > 3, rs.Length - 3, 0)) While rs <> "" str = Right(rs, 2) & "," & str rs = Left(rs, IIf(rs.Length > 2, rs.Length - 2, 0)) End While IndiaRupees = "Rs. " & str End Function
In Datagrid's Item DataboundDim lbl_Amt As Label lbl_Amt = IndiaRupees(CType(e.Item.FindControl("lbl_Amount"), Label).Text)
Prakash Samariya