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

Grid View Nested Grouping

5 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 28 Oct 2010, 10:55 AM
Hi all,

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

Sort by
0
Vlad
Telerik team
answered on 28 Oct 2010, 11:06 AM
Hi Adam,

 Generally you can declare different GroupHeaderTemplate for every column. Please check this demo for more info. 

Regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Adam
Top achievements
Rank 1
answered on 28 Oct 2010, 01:10 PM
Ok, sorted on that front. Thanks!

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>

 

 

 

 

0
Vlad
Telerik team
answered on 28 Oct 2010, 01:34 PM
Hello Adam,

 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Adam
Top achievements
Rank 1
answered on 03 Nov 2010, 01:03 PM
Hi Vlad,

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
0
Vlad
Telerik team
answered on 09 Nov 2010, 08:14 AM
Hi Adam,

 You can use Items collection of the group itself to get reference to desired item. 

Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Adam
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Adam
Top achievements
Rank 1
Share this question
or