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

RadGridView expand/collapse notification with virtualiing panel

3 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 12 Jul 2013, 02:48 PM
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.

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 17 Jul 2013, 10:44 AM
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 >>
0
Alan
Top achievements
Rank 1
answered on 17 Jul 2013, 03:10 PM
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.
0
Dimitrina
Telerik team
answered on 22 Jul 2013, 01:23 PM
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 >>
Tags
GridView
Asked by
Alan
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Alan
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or