Formatting Numeric Columns

The DataGrid control allows you to format individual columns, and the Property Builder dialog box makes it easy to add this functionality. You might, for example, want to format the Product Sales column so that the numbers are right aligned and formatted as currency.

To add this functionality, follow these steps:

1.
With CategorySales.aspx open in the page designer, right-click the DataGrid control.
2.
Select Property Builder from the context menu.
3.
On the grdCatSales Properties dialog box, select the Format tab and then expand the Columns node. Expand the “Columns[3]—Product Sales” node and select Items. (Effectively, you'll drill down into the various members of the grid until you get to the column you'd like ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.