RadGridView expand/collapse notification with virtualiing panel

4 posts, 0 answers
  1. Alan
    Alan avatar
    2 posts
    Member since:
    Jul 2013

    Posted 12 Jul 2013 Link to this post

    When virtualizing is turned on, a group is collapsed when its out of visible area and expands if it needs to when it returned to the visible area.  I need to display a count of all expanded groups for the user.  How can I get the "actual" expand count from the RadGridView?  Since the RadGridView is auto-expanded when they come back, it obviously knows whatn needs to be expanded.
  2. Yoan
    Admin
    Yoan avatar
    1189 posts

    Posted 17 Jul 2013 Link to this post

    Hello Alan,

    In order to achieve your goal, you can subscribe to the GroupRowIsExpandedChanged end execute the following logic:

    public MainWindow()
          {
              InitializeComponent();
              this.clubsGrid.GroupRowIsExpandedChanged += new EventHandler<Telerik.Windows.Controls.GridView.GroupRowEventArgs>(clubsGrid_GroupRowIsExpandedChanged);
          }
     
          List<IGroup> expandedGroups = new List<IGroup>();
     
          void clubsGrid_GroupRowIsExpandedChanged(object sender, Telerik.Windows.Controls.GridView.GroupRowEventArgs e)
          {
     
              if (e.Row.IsExpanded)
              {
                  this.expandedGroups.Add(e.Row.Group);
              }
              else
              {
                  this.expandedGroups.Remove(e.Row.Group);
              }
     
          }


    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Alan
    Alan avatar
    2 posts
    Member since:
    Jul 2013

    Posted 17 Jul 2013 Link to this post

    You just decribed what I was doing that didn't work.  The issue is that when an expanded row moves out of the viewable area, the RadGridView collapses the group *for me*.  And when I say collapses then view, I mean it calls myGrid_GroupRowIsExpandedChanged with the IsExpanded = false.  So, in your example, the item would be removed from the List<IGroup> the moment it went out of view.  And that's the problem I have right now.  its not in the viewable area, but it should still be expanded.
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 22 Jul 2013 Link to this post

    Hello,

    Due to the UI Virtualization only the rows to be displayed in View of the GridView will be realized. When you scroll, the not-visible rows will be loaded and unloaded. This is explained in this help article.

    That is why the myGrid_GroupRowIsExpandedChanged event is fired multiple times as you describe. Unfortunately there is not a public property holding the list of all the groups being expanded.

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top