This question is locked. New answers and comments are not allowed.
Hi, guys.
Here is what we have:
1. We're loading ~ 5-10 thousands of items into grid which has RowVirtualization enabled and has some groups.
2. All groups are collapsed by default and the data is displayed fast.
3. There is also a button on the form which is used to expand all grid groups with the following code:
//This is the method of of RadGridView child class we have in our project
private void ExpandGroupByIndentLevel(int level)
{
var groupRows = this.ChildrenOfType<GridViewGroupRow>().Where(r => r.Level == level && !r.IsExpanded);
foreach (var groupRow in groupRows)
{
groupRow.IsExpanded = true;
}
}
So..this code doesn't work when RowVirtualization is enabled. In this case only visible rows are expanded.
And we can't disable Row Virtualization because while expand all works there, it takes forever to display the data in that case.
So, how should we manage this?
Thanks in advance.
Alexander.
Here is what we have:
1. We're loading ~ 5-10 thousands of items into grid which has RowVirtualization enabled and has some groups.
2. All groups are collapsed by default and the data is displayed fast.
3. There is also a button on the form which is used to expand all grid groups with the following code:
//This is the method of of RadGridView child class we have in our project
private void ExpandGroupByIndentLevel(int level)
{
var groupRows = this.ChildrenOfType<GridViewGroupRow>().Where(r => r.Level == level && !r.IsExpanded);
foreach (var groupRow in groupRows)
{
groupRow.IsExpanded = true;
}
}
So..this code doesn't work when RowVirtualization is enabled. In this case only visible rows are expanded.
And we can't disable Row Virtualization because while expand all works there, it takes forever to display the data in that case.
So, how should we manage this?
Thanks in advance.
Alexander.
6 Answers, 1 is accepted
0
Accepted
Hi,
Vlad
the Telerik team
You should avoid working directly with UI elements in both WPF and Silverlight at all costs! Please use ExpandAllGroups() method or AutoExpandGroups property instead.
Greetings,Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Alexander
Top achievements
Rank 1
answered on 27 Mar 2012, 12:38 PM
Hi, Vlad
Thanks for you answer. But how can we trigger expanding only specific level of grouping?
As I understand the solutions you suggest will expand all the group levels we have.
Thanks for you answer. But how can we trigger expanding only specific level of grouping?
As I understand the solutions you suggest will expand all the group levels we have.
0
Accepted
Hi,
Vlad
the Telerik team
With Silverlight 5 you can have bindings in style setter which in this case can help you to create custom style for GridViewGroupRow with conditional IsExpanded Binding (depending on level).
Greetings,Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Alexander
Top achievements
Rank 1
answered on 27 Mar 2012, 12:46 PM
Thank you, Vlad.
Do I understand it right, that there is no solution for SL4?
Cheers,
Alexander.
Do I understand it right, that there is no solution for SL4?
Cheers,
Alexander.
0
Hello,
Vlad
the Telerik team
With Silverlight 4 you can try GroupRowStyleSelector to achieve your goal.
All the best,Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Alexander
Top achievements
Rank 1
answered on 27 Mar 2012, 12:55 PM
Many thanks for your help, Vlad.
I'll try to utilize that class.
Cheers,
Alexander.
I'll try to utilize that class.
Cheers,
Alexander.