Telerik ASP.NET Grid - format the GridNumericColumn decimal places on edit

By default, when a RadGrid GridNumericColumn displays numbers in edit mode, it will display the minimum decimal places. In order to have consistent formatting, use the code below

 

<telerik:GridNumericColumn HeaderText ="Quantity"  DataField ="Quantity" AllowRounding="true"  DecimalDigits="1" DataFormatString="{0:#,###.0}"   ItemStyle-HorizontalAlign="Right" ></telerik:GridNumericColumn>
<telerik:GridNumericColumn HeaderText ="UnitPrice"  DataField ="unitprce" AllowRounding="true" DecimalDigits="5" DataFormatString="{0:#,###.00000}" ItemStyle-HorizontalAlign="Right" ></telerik:GridNumericColumn>

 

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences