How to display conditional NumericTextbox in kendoreact grid

1 Answer 7 Views
Grid NumericTextBox
Abhishek
Top achievements
Rank 1
Iron
Iron
Iron
Abhishek asked on 28 Mar 2024, 05:17 AM | edited on 28 Mar 2024, 05:49 AM
I am  using a customNumeric textbox component for incell editing in a grid. But the numeric textbox is dependent on a checkbox column. If the checkbox cell is checked in the grid, then only i want to enable the numeric textbox in in-cell edit. Kindly help

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 29 Mar 2024, 11:04 AM

Hello, Abhishek,

You can achieve that by adding a similar check to the onClick handler of the custom edit cell renderer and enter in edit mode only if the checkbox value is true:

          onClick: () => {
            if (
              cellField == 'FiledOfTheEditedColumn' &&
              !dataItem.FieldOfTheCheckboxColumn
            ) {
              return;
            } else {
              props.enterEdit(dataItem, cellField);
            }
          },

For convenience, I prepared a sample where you can test the suggested approach where the cells in the `Units in Stock` column will not enter in Edit mode unless the value of the `Discontinued` column is true:

I hope this case but do let me known in case I can assist you any further on this matter.

Regards,
Vessy
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Tags
Grid NumericTextBox
Asked by
Abhishek
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Vessy
Telerik team
Share this question
or