In my application i have defined a RadGridView which is grouped on 2 Levels.
1) Year
2) By Year Quarter.
This works great!
Now what i would like to do is for the Group Header for the Year Quarter is provide a custom Group Header Template but keep the Group Header for Year intact.
I can't see anyway of doing this in XAML, but i suspect it could be done via code.
Any thoughts on the best way to go about this?
Cheers,
5 Answers, 1 is accepted
Generally you can declare different GroupHeaderTemplate for every column. Please check this demo for more info.
Regards,Vlad
the Telerik team
I want to include a hyperlink button who tag property it bound to a property of the underlying row.
The code below is how i would have expected it to happen, however I am not getting the 'Tag' property populated for some reason?
Anyone?
Cheers,
<telerik:GridViewDataColumn IsVisible="true" DataMemberBinding="{Binding YearPeriod}"> <telerik:GridViewDataColumn.GroupHeaderTemplate>
<DataTemplate>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
<TextBlock Text="{Binding Group.Key}" Width="850"/>
<HyperlinkButton x:Name="btnUpdateItem" Content="[ Update ]" Click="btnUpdateItem_Click" Tag="{Binding YearPeriodID}"/>
</StackPanel>
</DataTemplate>
</telerik:GridViewDataColumn.GroupHeaderTemplate>
</telerik:GridViewDataColumn>
The DataContext of this template is the group itself however you most probably want to access a property of the first group item?
Best wishes,Vlad
the Telerik team
Yes, access to a property value in the first group would be sufficient!
Can you point me in right right direction on how to do this in xaml?
Cheers
Adam
You can use Items collection of the group itself to get reference to desired item.
Greetings,Vlad
the Telerik team