This question is locked. New answers and comments are not allowed.
Voss Grose
Top achievements
Rank 1
Voss Grose
asked on 05 Dec 2009, 06:35 PM
Is it possible to set the height of a GroupHeader?
3 Answers, 1 is accepted
0
Hello Voss Grose,
Kalin Milanov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
There is a way to adjust the height of the group header though it will require editing the template of the group row. Attached I am sending you a sample application which does just that.
I hope you will find it useful.
Kalin Milanov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Voss Grose
Top achievements
Rank 1
answered on 08 Dec 2009, 01:19 AM
Thanks for the zip, but I was pretty overwhelmed by the zip file you sent.
Is all of that code necessary to alter the height of a group header?
This is my group header template xaml code (from the direction of previous Telerik assistance):
<telerik:RadGridView.GroupHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Header, Converter={StaticResource TimeConverter}}" Loaded="Group_Loaded" Width="375" Height="12" FontSize="10">
<telerikNavigation:RadContextMenu.ContextMenu>
<telerikNavigation:RadContextMenu EventName="MouseRightButtonDown">
<telerikNavigation:RadContextMenu.Items>
<telerikNavigation:RadMenuItem Header="Block Time Slots" Click="OnMenuItemClick" Tag="Block" />
<telerikNavigation:RadMenuItem Header="Un-Block Time Slots" Click="OnMenuItemClick" Tag="Un-Block" />
<telerikNavigation:RadMenuItem Header="Add Time Slot" Click="OnMenuItemClick" Tag="Add" />
</telerikNavigation:RadContextMenu.Items>
</telerikNavigation:RadContextMenu>
</telerikNavigation:RadContextMenu.ContextMenu>
</TextBlock>
</DataTemplate>
</telerik:RadGridView.GroupHeaderTemplate>
<telerik:RadGridView.GroupDescriptors>
<data:GroupDescriptor Member="Time">
<!--
<data:GroupDescriptor.AggregateFunctions>
<data:CountFunction Caption="COUNT: " />
</data:GroupDescriptor.AggregateFunctions>
-->
</data:GroupDescriptor>
</telerik:RadGridView.GroupDescriptors>
Is all of that code necessary to alter the height of a group header?
This is my group header template xaml code (from the direction of previous Telerik assistance):
<telerik:RadGridView.GroupHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Header, Converter={StaticResource TimeConverter}}" Loaded="Group_Loaded" Width="375" Height="12" FontSize="10">
<telerikNavigation:RadContextMenu.ContextMenu>
<telerikNavigation:RadContextMenu EventName="MouseRightButtonDown">
<telerikNavigation:RadContextMenu.Items>
<telerikNavigation:RadMenuItem Header="Block Time Slots" Click="OnMenuItemClick" Tag="Block" />
<telerikNavigation:RadMenuItem Header="Un-Block Time Slots" Click="OnMenuItemClick" Tag="Un-Block" />
<telerikNavigation:RadMenuItem Header="Add Time Slot" Click="OnMenuItemClick" Tag="Add" />
</telerikNavigation:RadContextMenu.Items>
</telerikNavigation:RadContextMenu>
</telerikNavigation:RadContextMenu.ContextMenu>
</TextBlock>
</DataTemplate>
</telerik:RadGridView.GroupHeaderTemplate>
<telerik:RadGridView.GroupDescriptors>
<data:GroupDescriptor Member="Time">
<!--
<data:GroupDescriptor.AggregateFunctions>
<data:CountFunction Caption="COUNT: " />
</data:GroupDescriptor.AggregateFunctions>
-->
</data:GroupDescriptor>
</telerik:RadGridView.GroupDescriptors>
0
Hi Voss Grose,
Kalin Milanov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I realize the amount of XAML needed to change the value of a simple property is rather big. The problem lies in the template of the group row (which is missing a proper Height binding) and thus setting the height only in GroupRowStyle results are less than satisfactory. That being said we are going to be implementing a fix which will reduce the amount of XAML needed to just 3 lines.
Until then the proposed solution is the best way of meeting your requirements.
Kalin Milanov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.