Collapse all and Expand all Button on the header of GridView

4 posts, 0 answers
  1. Ravi
    Ravi avatar
    104 posts
    Member since:
    Oct 2012

    Posted 14 Apr 2011 Link to this post

    Hi,

    how do i achieve a PLUS and MINUS symbol on the header to collapse and expand all functionality on the RADGRIDVIEW. I am using the latest version.

    Thanks,
    Shiras
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 14 Apr 2011 Link to this post

    Hi David,

     

    May you provide a bit more details about your exact requirement? Do you need to change the expander button either in the GridViewGroupRow or the expand button in GridViewRow? Any additional information about the desired final result would be highly appreciated. Thus we would be able to provide you with an adequate solution. 


    Kind regards,
    Vanya Pavlova
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Ravi
    Ravi avatar
    104 posts
    Member since:
    Oct 2012

    Posted 14 Apr 2011 Link to this post

    On the header of the parent row grid, i will need a button which will help the user upon clicking will either collapse all the rows which are expanded nor expand all the rows which are collapsed.

    but intention is to give an option to the user to expand all rows and collapse all rows on a single click, the user should not have to goto each row expand/collapse.

    Hope this clears?

    Thanks
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 15 Apr 2011 Link to this post

    Hi David,

     

    You can use ExpandAllHierarchyItems()/CollapseAllHierarchyItems() methods of RadGridView for hierarchy. Once you may get access to the GridViewToggleButton in you need to subscribe to the Checkec/UnChecked events of GridViewToggleButton and apply the appropriate logic:

    private void RadGridView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
          {
              var row = e.Row as GridViewRow;
              if (row != null)
              {
                  var toggleButton = row.ChildrenOfType<GridViewToggleButton>().FirstOrDefault();
                  if (toggleButton != null)
                  {
     
                    //your code
                  }
              }
          }

    Best wishes,
    Vanya Pavlova
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top