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

Virtualization + Grouping. Expanding all is not possible?

6 Answers 100 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alexander
Top achievements
Rank 1
Alexander asked on 27 Mar 2012, 12:28 PM
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.

6 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 27 Mar 2012, 12:32 PM
Hi,

 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.
0
Accepted
Vlad
Telerik team
answered on 27 Mar 2012, 12:41 PM
Hi,

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.
0
Vlad
Telerik team
answered on 27 Mar 2012, 12:50 PM
Hello,

 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.
Tags
GridView
Asked by
Alexander
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Alexander
Top achievements
Rank 1
Share this question
or