How to edit custom cells in Incell editing?

1 Answer 107 Views
Grid
Abhishek
Top achievements
Rank 2
Iron
Iron
Iron
Abhishek asked on 23 Nov 2023, 07:05 AM
I have six columns in the grid. I have to perform incell edit  in the grid.  when i click on each cell, i want to display a custom dropdown in 2 columns & custom check boxes in 2 columns & text boxes in 2 columns.  I tried this example,  https://www.telerik.com/kendo-react-ui/components/grid/editing/editing-in-cell/ . but the problem i am facing is if i click on any cell, all the cells in the row is getting enabled.  Kindly help me.

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 23 Nov 2023, 06:50 PM

Hello Abhishek,

The easiest way for providing custom editors to the KendoReact Grid is through the "cells" property. I have created an example demonstrating such implementation where the "ProductName" and "Discontinued" fields use custom editors:

Please give this a try and let us know if further questions arise. 

 

Regards,
Konstantin Dikov
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!

Abhishek
Top achievements
Rank 2
Iron
Iron
Iron
commented on 24 Nov 2023, 10:03 AM | edited

I have custom dropdowns as well. Can you please add dropdowns to the example?
Abhishek
Top achievements
Rank 2
Iron
Iron
Iron
commented on 24 Nov 2023, 12:56 PM

Also i see in the example true/false is displaying in non-edit mode. But i have to display checkboxes in non-edit mode as well with exsisting values(checked/unchecked)
Konstantin Dikov
Telerik team
commented on 24 Nov 2023, 03:32 PM

I have modified the example to show checkbox in the view mode as well and a DropDownList for the ProductName column;

Hope this helps.

Abhishek
Top achievements
Rank 2
Iron
Iron
Iron
commented on 27 Nov 2023, 07:00 AM

Hi Konstantin, thank you for the quick help. Actually in my code , i have moved all  custom cells to a new file & i am trying to trigger the custom cell in the parent page & also passing some parameters. But the event in the child page is not getting triggered. Please help

<GridColumn

                    width="200px"
                    field="countryName"
                    title="Country Assignment"
                    cells={{edit :{text: ((e)=> CountryCell(e,insertUpdateRow, countries))}}}
                  />
Konstantin Dikov
Telerik team
commented on 28 Nov 2023, 09:39 PM

HI Abhishek,

Defining inline functions should be avoided, because this will force the re-mounting of the entire Grid on each change. You need to set only the custom cell name and define it outside of the main component. For passing additional data to the custom cells you have to use React Context.

I have modified the previous example to use React Context for passing additional data and I have also moved the definition in separate file:

Hope this helps.

Tags
Grid
Asked by
Abhishek
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or