How can we format data inside the DataGrid ?

 Posted by Bharathi Cherukuri on 2/28/2012 | Category: ASP.NET Interview questions | Views: 3255 | Points: 40

We can use DataFormatString Property to format the data inside the DataGrid.

If the DataFormatString property is not set, the field's value is displayed without any special formatting.



<asp:BoundField HeaderText="Product ID" DataField="ProductID" />
<asp:BoundField HeaderText="UnitPrice" DataField="UnitPrice" DataFormatString="{0:F0}" />

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response