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

[Solved] Aligning Grouping Content with Grid Content

2 Answers 34 Views
Grid for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Thomas
Top achievements
Rank 1
Thomas asked on 16 Jul 2013, 12:31 AM

What would be the best way to align content within a group data template with child columns the grid rows?

 

 

 

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosy Topchiyska
Telerik team
answered on 16 Jul 2013, 12:41 PM
Hello Thomas,

Thank you for your question.

Generally, RadDataGrid does not support such functionality out-of-the-box so you will need to customize the desired position manually. One possible approach that we would suggest is to calculate the sum of column widths previous to the grouping column and use the calculated value as left margin of the group header.

For your convenience we have prepared a runnable application to get you started so you can evaluate whether this solution would be useful for you scenario. We use a HeaderPositionToMarginConverter class that implements the IValueConverter interface and in the Convert method we calculate the desired margin of the header (you can play a bit with the parameters to adjust the exact position). Then we use a TextBlock as a DataTemplate for the group header and bind its Margin property to the GroupHeaderContext using the HeaderPositionToMarginConverter class.

Hope this helps.


Regards,
Rositsa Topchiyska
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Thomas
Top achievements
Rank 1
answered on 16 Jul 2013, 03:49 PM
Thank you.  This gives me some good ideas.
Tags
Grid for XAML
Asked by
Thomas
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or