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

GridView Row Expanding Collapsing

1 Answer 262 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ahmed
Top achievements
Rank 1
Ahmed asked on 02 Jun 2017, 06:07 PM
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

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 05 Jun 2017, 07:31 AM
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.
Tags
GridView
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or