This is a migrated thread and some comments may be shown as answers.

Inline Numeric Field Shows Negative Values

1 Answer 423 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Basim
Top achievements
Rank 1
Basim asked on 22 Jan 2020, 06:13 AM
i need to add numeric values in grid with inline add and edit.I use Editor = numeric and it shows only numeric values but i need to block negative values.How can i block negative values

1 Answer, 1 is accepted

Sort by
2
Stefan
Telerik team
answered on 22 Jan 2020, 09:31 AM

Hello, Basim,

There are two options in this case:

1) On the onItemChange event of the Grid, check if the value written in the numeric field is less then 0 and if it is, do not change the state.

https://www.telerik.com/kendo-react-ui/components/grid/api/GridProps/#toc-onitemchange

2) Use a custom NumericTextBox editor in the Grid and set its min value to 0:

https://www.telerik.com/kendo-react-ui/components/grid/editing/editing-custom/ - custom editor

- https://www.telerik.com/kendo-react-ui/components/inputs/api/NumericTextBoxProps/#toc-min - min value.

I hope one of these two approaches proves helpful.

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Basim
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or