Answer: 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.
Example:
<Columns>
<asp:BoundField HeaderText="Product ID" DataField="ProductID" />
<asp:BoundField HeaderText="UnitPrice" DataField="UnitPrice" DataFormatString="{0:F0}" />
</Columns>
Asked In: Many Interviews |
Alert Moderator