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

[Solved] Maintaing a groups expanded state when the Edit link is selected

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kyle Kelin
Top achievements
Rank 1
Kyle Kelin asked on 04 Aug 2009, 08:09 PM
 I am grouping on a column called Category and have a Edit button that is automatically generated for each item. When the user first loads the page all groups should be collapsed. I can get this to work by setting the GroupDefaultExpanded property. However after setting this property when I click Edit  my edit form no longer works. It appears that the Edit command fires but the all the groupings collapse and hide it.

How do set all groupings to initial start as collapsed but for a row to maintain its expanded state when the Edit link is selected?

Thanks,

Kyle

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Aug 2009, 06:06 AM
Hi Kyle,

Try the following code snippet to collapse all the Groupings initially.

CS:
 
private void CollapseAll() 
   foreach( GridItem item in RadGrid1.MasterTableView.Controls[0].Controls ) 
   { 
        if( item is GridGroupHeaderItem ) 
       { 
           item.Expanded = false
       } 
   } 
private void Page_Load(object sender, System.EventArgs e) 
   if( !IsPostBack ) 
   { 
       this.RadGrid1.Rebind(); 
       this.CollapseAll(); 
   } 
 


Thanks
Princy
Tags
Grid
Asked by
Kyle Kelin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or