We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Question about numeric formatting


I have a datagrid where I have a GridNumeriColumn that represents a distance.

I would like to have the following requisites on this column but I'm not able to obtain them:

1) If the number does have decimals I would like they are not shown even if I put NumberDecimalDigits="2".
    For example, if the user types 1000, I would like 1000 is displayed, but if he types 890.18, I would like 890.18 is displayed.

2) I would like the current unif of measure is displayed after the number, even if the user can't modify it (as it happens for example for '%' for percentage columns).
    For example I would like the column shows "1000 mm", "890.18 mm" and so on.

Can you help me ?

1 Reply

SP Sowndaiyan Paulpandi Syncfusion Team January 29, 2016 10:41 AM UTC

Hi Silvio,

Thanks for contacting Syncfusion Support.

In SfDataGrid , You can achieve your requirement with the help of the IValueConverter in the DisplayBinding property and format the display of the GridNumericColumn. We have prepared a sample as per your requirement and you can download the same form the below location. In this sample the converter is invoked for each cell in the GridNumericColumn and the display format can be customized.

Sample : http://www.syncfusion.com/downloads/support/forum/121824/ze/GridNumericColumn_Format1290330637



Live Chat Icon For mobile
Up arrow icon