- Home
- Forum
- ASP.NET Core - EJ 2
- NumericEdit column max/min not working
NumericEdit column max/min not working
I've got a grid with a column like:
new Syncfusion.EJ2.Grids.GridColumn() {
Field="CustomizableColors",
HeaderText="Custom Colors",
TextAlign=Syncfusion.EJ2.Grids.TextAlign.Center,
Format="n0",
EditType="numericedit", Width="120",
Edit=new Syncfusion.EJ2.Inputs.NumericTextBox() {
ValidateDecimalOnType = true,
Decimals = 0,
Format = "n0",
Max=2, Min=0
}}
When I click the up/down buttons, or manually enter a number into the box, the Max/Min are not respected in any way. I was expecting that clicking the up/down button would simply not increment/decrement outside the requested range. I did try adding "StrictMode = true", in case that was somehow different from the default, but it doesn't help.
Hi R Brian Lindahl,
Greetings from Syncfusion support.
Based on the information provided, it has been observed that you are experiencing an issue where the minimum and maximum values are not functioning correctly with the NumericTextBox component rendered in the edit form of the Syncfusion Grid. This issue arises because the edit->params property of the column has not been defined correctly. Kindly refer to the code example provided below, along with the attached sample and video demonstration, where we have correctly defined the edit params, ensuring that the minimum and maximum values work as intended.
|
Index.cshtml
var Columns = new List<Syncfusion.EJ2.Grids.GridColumn> { …………………………. new Syncfusion.EJ2.Grids.GridColumn(){ Field="Freight", HeaderText="Freight", Width="120", Format="N0", TextAlign=Syncfusion.EJ2.Grids.TextAlign.Right, EditType="numericedit", Edit=new { @@params = new Syncfusion.EJ2.Inputs.NumericTextBox() { ValidateDecimalOnType = true, Decimals = 0, Format = "N0", Max=2, Min=0 } } }, };
|
Sample and video demonstration: Please find in the attachment.
Note: The StrictMode is enabled by default, which enforce the min/max limits.
API Reference:
If you need any other assistance or have additional questions, please feel free to contact us.
Regards
Aishwarya R
Attachment: SampleAndVideo_cab1e1a4.zip
Thank you, I'll give this a try.
Is this documented anywhere? This is the first time that I've seen this syntax for a column control; if I remember correctly, the documentation shows assigning "edit" with the javascript function names to be called for read, write, etc.
Hi IR Brian Lindahl,
Query1: Is this documented anywhere? This is the first time that I've seen this syntax for a column control;
Yes, we have documentation available on how to customize the editor using the 'edit->params' property according to the 'editType' of the column. For more detailed information, please refer to the documentation link provided below.
Documentation Link: Customize-editors-using-params
Query 2: if I remember correctly, the documentation shows assigning "edit" with the javascript function names to be called for read, write, etc.
The edit property of the column indeed allows for the use of external functions create, read, write, and destroy to render custom components as editTemplate within a Grid column. Please refer to the below documentation link for more details.
Documentation Link: Custom-editors-using-template
Regards,
Aishwarya R
- 3 Replies
- 2 Participants
-
RB R Brian Lindahl
- Nov 22, 2024 03:19 PM UTC
- Dec 5, 2024 07:12 PM UTC