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

Custom Read only / editable grid cell

1 Answer 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matej
Top achievements
Rank 1
Veteran
Matej asked on 14 Dec 2020, 01:30 PM

Hi,

I have a custom cell where I can have 2 states (read only and editable). The problem is that GridCellProps does not contain any information about column edit mode. Example https://stackblitz.com/edit/react-qzapj7?file=app/main.jsx 

<Column
      field="Discontinued"
      title="Discontinued"
      cell={DropDownCell}
      editable={false} // no access to "editable" from DropDownCell
/>

 

and something like this 

<Column
      field="Discontinued"
      title="Discontinued"
      cell={editable? DropDownCellEdit : DropDownCellReadOnly }
/>

or 

<Column
      field="Discontinued"
      title="Discontinued"
      cell={(props) => <DropDownCell {...props} editable={editable}/> }
/>

is not possible in my case.

Any plans to add this information to GridCellProps ?

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Dec 2020, 07:55 AM

Hello, Matej,

Currently, this can be done by passing the editable value to the custom cell using this approach:

https://www.telerik.com/kendo-react-ui/components/grid/cells/#toc-customization

This information is not passed as we use it internally when we render the cells. If the developer is using a custom cell, we assume that this information can be provided by the developer as extra props.

Still, I will check with the team if we can pass all props to the custom cell, the remove the need to pass manually pass props.

Regards,
Stefan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Matej
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Share this question
or