Progrmatically Expand\Collapse Selected Group header

2 posts, 0 answers
  1. Srujan
    Srujan avatar
    18 posts
    Member since:
    Oct 2010

    Posted 22 May 2013 Link to this post

    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;

    }

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 27 May 2013 Link to this post

    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.
Back to Top