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

Make GroupHeaderTemplate as wide as the grid

1 Answer 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dave Aronow
Top achievements
Rank 1
Dave Aronow asked on 23 Mar 2012, 03:15 PM
I am using the GroupHeaderTemplate to display field-level information (grouping on a unique key for each row to force one group per item) but since I am doing this I need to find a way to get the group header to be as wide as the grid (so that the right-most control appears flush against the right edge of the grid).  

I tried using StackPanels set to stretch but I can't get the header to be any wider than the controls contained in it (I assume this is by design which is usually what you want).   One hack I tried is putting an empty textblock before the control I need to be all the way to the right) which moves the control over but that then requires handling resizing events and recalculating the "filler" width and is a general nightmare. 

Is there any other way I can do this?

Thanks.
Dave

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 27 Mar 2012, 04:39 PM
Hi David, 

Generally, you will need to edit the template of GridViewGroupRow and remove the elements reserved for the aggregates. Afterwards you can set HorizontalAlignment property of the StackPanel. 
I am attaching a sample project illustrating the suggested approach.


Regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
GridView
Asked by
Dave Aronow
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or