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

Group expanding and collapsing events

3 Answers 204 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian Lam
Top achievements
Rank 1
Brian Lam asked on 26 Jul 2010, 11:18 PM
Hi,

I'm trying to defer loading the detail rows inside RadGridView's groups until the group header is expanded; when the group header is collapsed, I just have a dummy row of data representing the group. To do this, I need GroupExpanded/Collapsed events. Are there any such events provided by RadGridView, or are there any plans to add them in the future?

- Brian

3 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 27 Jul 2010, 03:41 PM
Hello Brian Lam,

You can try with GridViewRow.IsExpandedChanged - occurs when GridViewRow changes its IsExpanded state. The type of the passed event arguments is RoutedEventArgs.

I hope this helps.

Regards,
Ross
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
0
Brian Lam
Top achievements
Rank 1
answered on 27 Jul 2010, 09:26 PM

I'm trying to track the expansion of groups, not hierarchical rows. GridViewRow.IsExpandedChanged is an event on the data rows; I need a way to track changes to GridViewGroupRow.IsExpanded, which doesn't inherit from GridViewRow.

Also, is there a way to get references to the GridViewGroupRows as they're added to/removed from the grid? It looks like they don't exist by the time the RadGridView.Grouped event is raised. For example, if I have an event handler like:

private void TheGrid_Grouped(object sender, GridViewGroupedEventArgs e)
{
 if (TheGrid.Items.Groups != null)
 {
  var groupContainers = TheGrid.Items.Groups.Select(group => TheGrid.ItemContainerGenerator.ContainerFromItem(group)).Cast<GridViewGroupRow>().ToList();
 }
}

Then TheGrid.Items.Groups is always null when I add the first grouping.

0
Accepted
Rossen Hristov
Telerik team
answered on 28 Jul 2010, 08:40 AM
Hi Brian Lam,

I am sorry for the misunderstanding.

We do not have such events for the groups and this is by design.

You are trying to achieve lazy-loading of groups which will break a lot of functionality such as aggregates, calculations for virtualization, etc, virtually everything. That is why we have not provided it out of the box.

Sincerely yours,
Ross
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
Tags
GridView
Asked by
Brian Lam
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Brian Lam
Top achievements
Rank 1
Share this question
or