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

Format for GridNumericColumn

Hello,

I am new to SyncFusion. I have created a SfDataGrid in a UWP desktop app. I have a column in the grid for the tax year. For my test, the tax year is 2019.

If I specify FormatString="D" in XAML:
     The cell is blank when displaying the value.
     The cell is blank when attempting to edit the value.

If I specify FormatString="0000" in XAML.
     The cell displays the value correctly: 2019
     The cell includes a comma when editing the value: 2,019

How do I remove the comma when the cell is being edited? (And, should the "D" format string work?)

Thank you,

Scott

2 Replies

SP Shobika Palani Syncfusion Team June 17, 2019 01:01 PM UTC

Hi Scott, 

Thank you for using Syncfusion Products. 

We have analyzed your query and we are able to reproduce the reported issue from our end. Currently we are validating the reported issue with high priority and we will update you with more details on 19th June,2019. 

Regards, 
Shobika. 



SP Shobika Palani Syncfusion Team June 19, 2019 02:05 PM UTC

Hi Scott, 
 
Thanks for your patience. 
 
We have analyzed reported case with FormatString of GridNumericColumn . For GridNumericColumn, we have loaded SfNumericTextBox as edit element. And your requirement to remove comma in edit mode can be achieved by setting SfNumericTextBox.EnableGroupSeparator in OnEditElementLoaded method of numeric column renderer. 
 
Please refer to the below code snippet 
 
this.sfgrid.CellRenderers["Numeric"] = new CustomGridCellNumericRenderer(); 
 
public class CustomGridCellNumericRenderer : GridCellNumericRenderer 
    { 
        protected override void OnEditElementLoaded(object sender, RoutedEventArgs e) 
        { 
            var numericTextBox = sender as SfNumericTextBox; 
            numericTextBox.EnableGroupSeparator = false; 
            base.OnEditElementLoaded(sender, e); 
             
        } 
    } 
 
Also please find the sample for the same from the below link 
 
Sample Link: 
 
Please let us know, if you require further assistance on this. 
 
Regards, 
Shobika. 


Loader.
Live Chat Icon For mobile
Up arrow icon