Passing Props to Detail row component

3 posts, 1 answers
  1. Howard
    Howard avatar
    5 posts
    Member since:
    Jun 2020

    Posted 04 Jul 2020 Link to this post

    Is it possible to pass props to the Detail Row Component from the parent grid component?
  2. Howard
    Howard avatar
    5 posts
    Member since:
    Jun 2020

    Posted 04 Jul 2020 in reply to Howard Link to this post

    I figured out a manner in which to pass the data I wanted by assigning the data as part of the dataItem object that is sent to the detail grid during the expand change event.

     

    expandChange = (event) => {
            event.dataItem.expanded = !event.dataItem.expanded;
            event.dataItem.midLevelColumns = this.props.midLevelColumns
            this.forceUpdate();
       }
  3. Answer
    Stefan
    Admin
    Stefan avatar
    3039 posts

    Posted 06 Jul 2020 Link to this post

    Hello, Howard,

    Thank you for sharing a possible solution with the KendoReact community, it is highly appreciated. 

    We can also recommend using a function that will return the detail component plus the custom props. The approach can be seen for custom cells, but the same one can be used for the details as well:

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

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top