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
close icon

Grid Cell Numeric Edit

Hi,
I am defining a grid with a column with EditType(EditingType.Numeric) To edit with the NumericTextBox editor.
The field is decimal type, but the editor allow me only to insert integer values.
I Noticed that there is a NumericEditOptions Helper in the Builder of the column.
I passed a Property of my Model of Type EditorProperties, in which I setted the Value of DecimalPlaces to 3.
The field keeps to allow only integer values, and doesn't accept the . and , characters.
Could you tell me what I am doing wrong and if is a problem to provide a workaround?
I have tried with the Inline and Dialog Type of Edit.

    Thanks in advance

    Andrea Perazzolo

1 Reply

SR Sellappandi Ramu Syncfusion Team May 15, 2015 01:41 PM UTC

Hi Andrea,

Thanks for using Syncfusion products.

Could you please share the following information to sort out the cause of the issue and provide you with prompt solution?

1. Could you please check whether you are using the NumericEditOptions property to set the decimal place of the column?

2. Please share your full grid code snippet to us or issue reproducing sample it will help us to provide the better solution.

We have tested the reported issue in our side and we are unable to reproduce it. For your kind information, if we set EditingType as Numeric to grid column it will accept the integer value. When we edit the numeric column it won’t accept the. (Dot) and, (comma) symbol. If we like to edit the decimal value in numeric column we need to use the NumericEditOptions property in that particular column and need to set the decimal place value based on our requirement. By default the numeric edit text box will accept the. (Dot) symbol when set the decimal places and the numeric textbox will accept symbol based on the locale which we are set for grid. Please refer the following code snippet.


@(Html.EJ().Grid<MVCGridEditing.OrdersView>("FlatGrid")

.Datasource((IEnumerable<object>)ViewBag.datasource)

.AllowPaging() /*Paging Enabled*/

.EditSettings(edit=>{edit.AllowAdding().AllowDeleting().AllowEditing(); })

.ToolbarSettings(toolbar =>

{

….

})

.Columns(col =>

{

….

col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).EditType(EditingType.Numeric)

.NumericEditOptions(new EditorProperties() { DecimalPlaces = 3 }).Add();

}))


We have created a sample and it can be downloaded from below link:

Sample link: http://www.syncfusion.com/downloads/support/forum/119146/MVCGridEditing-1651957397.zip

Please try the above sample and get back to us with mentioned details, if the provided information does not meet you requirement.

Regards,
Sellappandi R

Loader.
Live Chat Icon For mobile
Up arrow icon