Custom Read only / editable grid cell

2 posts, 0 answers
  1. Matej
    Matej avatar
    69 posts
    Member since:
    Jun 2019

    Posted 14 Dec 2020 Link to this post

    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 ?

  2. Stefan
    Admin
    Stefan avatar
    3008 posts

    Posted 15 Dec 2020 Link to this post

    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/.

Back to Top