GridView Row Expanding Collapsing

2 posts, 0 answers
  1. Ahmed
    Ahmed avatar
    29 posts
    Member since:
    Dec 2015

    Posted 02 Jun 2017 Link to this post

    I have gridview and i want when i expand specific row, all other rows are collapsed
    I do not want two rows to be expanded at the same time
  2. Dimitar
    Admin
    Dimitar avatar
    2838 posts

    Posted 05 Jun 2017 Link to this post

    Hi Ahmed,

    You can use the ChildViewExpanding event and collapse the expanded rows:
    private void RadGridView1_ChildViewExpanding(object sender, ChildViewExpandingEventArgs e)
    {
        foreach (var item in radGridView1.Rows)
        {
            if (item != e.ParentRow && item.IsExpanded)
            {
                item.IsExpanded = false;
            }
        }
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top