Expand One Grid Row Only at a Time with React

3 posts, 1 answers
  1. Raef
    Raef avatar
    2 posts
    Member since:
    Oct 2020

    Posted 06 Oct 2020 Link to this post

    Hello

    How to expand One Grid Row Only at a Time with React, the behavior needed is that all the rows will be collapsed when i expand a row.

    I found a solution with jquery but not in React.

    Thank you in advance.

  2. Answer
    Stefan
    Admin
    Stefan avatar
    3034 posts

    Posted 07 Oct 2020 Link to this post

    Hello, Raef,

    The expanded state of the details is part of the data.

    I can suggest on the onExpandChange event to set the expanded state to expanded on the currently clicked detail and set the expanded field to false to all other items.

    I made an example showcasing this:

    https://stackblitz.com/edit/react-fmmump?file=app/main.jsx

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

  3. Raef
    Raef avatar
    2 posts
    Member since:
    Oct 2020

    Posted 09 Oct 2020 in reply to Stefan Link to this post

    Thank you, this is exactly what i need.
Back to Top