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

GridView with Child List All Automatically expanded

2 Answers 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 21 Aug 2008, 06:25 PM
I have a gridview with a child list and I want all records
and lists to be fully expanded (opened) verses collapsed.  What is the recommended approach to this scenario?

Thank you.

2 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 22 Aug 2008, 11:19 AM
Hi Michael,

Thank you for writing.

To expand all rows in RadGridView you have to iterate through them and set the IsExpanded property to true. Please, review the code-block below as example:
private void ExpandAllRows(RadGridView grid, bool expand) 
    grid.GridElement.BeginUpdate(); 
 
    foreach (GridViewRowInfo row in grid.Rows) 
    { 
        row.IsExpanded = expand; 
    } 
 
    grid.GridElement.EndUpdate(); 

I hope this helps, if you have other questions, do not hesitate to contact me again.

All the best,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 22 Aug 2008, 07:08 PM
Thank you for the reply.  Just what I was looking for.


Tags
GridView
Asked by
Michael
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Michael
Top achievements
Rank 1
Share this question
or