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

Numeric Edit in Grid without formatting

Hello, I am using syncfusion Ej Grid in MVC.

I am using grids.EditMode(EditMode.InlineForm) for add and edit and I have a couple of numeric fields which I am adding in grid like this.
but when it loads data in it it has formatting of thousand like '1,011' when we remove focus from the textbox.  i wanted to remove this formatting so that it will always display data like '1011'   
Do we have any option for this to achieve this?

col.Field(x => x.Thickness)
        .TextAlign(TextAlign.Left)
        .EditType(EditingType.NumericEdit).NumericEditOptions(new EditorProperties() { DecimalPlaces = 0, ShowSpinButton = false })
        .Width(50)
        .Add();

1 Reply

VN Vignesh Natarajan Syncfusion Team December 20, 2018 12:44 PM UTC

Hi Sandip, 
 
Thanks for contacting Syncfusion Support. 

From your query, we suspect that you need to display the value inside the numeric textbox without (,) separator for thousand. To remove the comma for Numeric values while on Focusing, you can use GroupSeparator property  of ejNumericTextBox inside the NumericEditOptions.
 
 
Please refer to the code example:- 
 
@(Html.EJ().Grid<OrdersView>("Grid") 
        .Datasource(ds => ds.URL("/Grid/UrlDataSource") 
        .Adaptor(AdaptorType.UrlAdaptor)) 
        .AllowPaging() 
         
 
        .Columns(col => 
        { 
            col.Field("VAT").TextAlign(TextAlign.Left).EditType(EditingType.NumericEdit).NumericEditOptions(new EditorProperties() { DecimalPlaces =0,GroupSeparator = "" }).Width(50).Add(); 
        }) 
         ) 
 
 
Pleaser refer to the API Link:- 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan 
 


Loader.
Live Chat Icon For mobile
Up arrow icon