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

Validate numeric entry on editing cell

I have fields that I only want to have numbers entered in, but I don't want the up and down arrows that you get with the numericedit editType - I just want to use the stringedit editType, but validate that only numbers are entered.  I tried adding  edit="@(new { @params = new { decimals=2 } })" but that didn't work.  How can I make sure only numbers are entered?  Thank you!

1 Reply

PS Pavithra Subramaniyam Syncfusion Team October 23, 2019 07:36 AM UTC

Hi Angela,  
 
Thanks for contacting Syncfusion support. 
 
You can achieve your requirement by using the “showSpinButton” property in edit params So you can disable the spin button of numeric textbox and ensure only the numbers are entered while editing. Please get back to us if you need any further assistance on this. 
 
[index.cshtml] 
        <e-grid-column field="EmployeeID" headerText="Name" width="120" editType="numericedit" edit="@(new {@params = new Syncfusion.EJ2.Inputs.NumericTextBox() { ShowSpinButton=false,Decimals = 2} })" ></e-grid-column> 
 
 
 
Please get back to us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 


Loader.
Up arrow icon