BOOK: Beginning ASP.NET DatabasesAlso see the forum ASP Databases for more general discussions of ASP database issues not directly related to these books.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
Does anyone know how to format an integer to include comma formatting? I.e. 123456 to 123,456.
I am populating a gridview from a code behind page in VB and using the code below to do some formatting, but cannot seem to figure out how to put in the commas in my numeric values.
Thanks!
'.... Formatting the rows. .................................................. ...............
If e.Row.RowType = DataControlRowType.DataRow And e.Row.Cells(1).Text <> "Totals"Then
x = 1
DoUntil x > 13
e.Row.Cells(x).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(x).Wrap = "False"
e.Row.Cells(x).Font.Name = "verdana"
e.Row.Cells(x).Font.Size = FontUnit.Point(10)
e.Row.Cells(x).BackColor = Drawing.Color.AliceBlue
x = x + 1
Loop
EndIf
DataFormatString="{0:c}" or in the GridView Tasks box that is available when in Design View select "Edit Columns" then select the column you need to format and type {0:N0} in the "DataFormatString" field