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

Progrmatically Expand\Collapse Selected Group header

1 Answer 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Srujan
Top achievements
Rank 1
Srujan asked on 22 May 2013, 07:58 PM
Hi Team ,

I am adding group by experissions progrmatically in my code and it is working as expected , I want to Expnad / Collpase selected group header , I am using below code in Item_Command and able to Collapse/Expand groups  as required but when I click next page Grid rebinds and grouping is lost , can you suggest how to go about this problem .

if (e.CommandName == RadGrid.ExpandCollapseCommandName)
 {
                GridGroupHeaderItem groupHeaderItem = (GridGroupHeaderItem)e.Item;
               
                if (groupHeaderItem.Expanded==true)
                    groupHeaderItem.Expanded = false;
                else
                    groupHeaderItem.Expanded = true;
}

Thanks
 NS

 

 

 

 

 

if (item.IsInEditMode)

item.Expanded =

 

false;

}

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 27 May 2013, 11:32 AM
Hello Srujan,

Possible solution is to keep track of expanded/collapsed groups and expand/collapse them appropriately in ItemDataBound event handler.
I hope this helps.

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Srujan
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or