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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Format for GridNumericColumn

Thread ID:

Created:

Updated:

Platform:

Replies:

145279 Jun 14,2019 10:10 PM UTC Jun 19,2019 02:05 PM UTC UWP 2
loading
Tags: SfDataGrid
Scott
Asked On June 14, 2019 10:10 PM UTC

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

Shobika Palani [Syncfusion]
Replied On 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. 


Shobika Palani [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon