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

Grouping Problems

4 Answers 120 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 01 Feb 2011, 08:18 PM
I am experiencing some odd behavior with Grouping.

1) Image Grouping 1.jpg relates to this behavior.  I have dragged my column (called 'TDC') to the Grouping Header.   Grouping shows correct, except for the rows where the value in the TDC column exceeded 8 characters.  For that the heading above the grouped row is blank. All other rows are grouped correctly and the heading shows correctly.  Note that the Grouped by displays TDC, which is correct.

2) Image Grouping 2.jpg relates to this behavior.   Instead of dragging the TDC column to the Grouping Header I am using the Right Click Context menu.  The code for this comes verbatim from the Telerik Examples for WPF.  The same grouping behavior as in 1 is observed.  The Grouped by displays CurrentTDCString instead of the TDC. The Unique Name is displayed instead of the Header Name.

3) Image Grouping 3.jpg relates to this behavior.  I have dragged my column (called 'Sub TDC') to the Grouping Header.   Grouping is done correctly, but the heading above all the grouped rows are always empty. 

Both the TDC and Sub TDC columns are bound to Combobox items. The difference between the TDC and Sub TDC columns are that the TDC column use the ItemsSource binding while the Sub TDC use the ItemsSourceBinding binding.  I have to do this because the items source for the Sub TDC column depends on the value selected in the TD column.

Help appreciated.

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 07 Feb 2011, 11:26 AM
Hello Stefan,

I was able to reproduce only the last reported issue. The reason for it is that when grouping, the grid is not aware of the multiple sources inside this column, i.e. each item presents its own ItemsSource for the GridViewComboBoxColumn due to the usage of ItemsSourceBinding. Consequently, the group headers are not displayed correctly because they cannot find all those sources.
What can be done is to predefine the GroupHeaderTemplate for the grid, define a TextBlock inside and bind its Text property by using an IValueConverter. This converter needs to expose all the items from all the sources and match them appropriately.    
I am sending you a sample project illustrating the suggested solution.
 

Regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Stefan
Top achievements
Rank 1
answered on 07 Feb 2011, 02:29 PM
Thanks for your response. Your solution has fixed problems 1 and 3 I have described.  The Grouping not works correctly. 

Problem 2 however still exist.  If I drag the column to be grouped the Column name displays correctly.  If I select the column from the right pop up menu,  the Unique Name is displayed instead of the Header Name.

0
Maya
Telerik team
answered on 07 Feb 2011, 05:45 PM
Hi Stefan,

I have tested the issue on the sample project I previously attached. However, even when distinct UniqueName-s are defined for the columns and the grid is grouped by the context menu, I was not able to reproduce the same behavior. 
Did you manage to get the same behavior on the application I sent ? 

Regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Stefan
Top achievements
Rank 1
answered on 07 Feb 2011, 07:22 PM
Your application is working.  Mine not.  Cannot figure out why.  I have change my UniqueName to match the Header.  Unfortuanely the UniqueName cannot cantain a space.  I can live with that.  Thanks for fixing the other problem.
Tags
GridView
Asked by
Stefan
Top achievements
Rank 1
Answers by
Maya
Telerik team
Stefan
Top achievements
Rank 1
Share this question
or