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

Show some Group Headers and hide Others

7 Answers 420 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 05 Jul 2012, 08:30 PM
All of the values in my Group Footers row show in the Group Headers row.  I would like to hide most of the values and show only 2.  How can I selectively show some values in the Group Header and hide others?

Thank you.

7 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 06 Jul 2012, 05:26 AM
Hello,

 You could predefine the GroupHeaderTemplate for the columns on which you would like to change the shown aggregate values. What I can suggest you is to check the approach shown on this online demo and apply it to your particular scenario. 
   

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ben
Top achievements
Rank 1
answered on 06 Jul 2012, 01:15 PM
Can you tell me how I define the GroupHeaderTemplate so that it's hidden?  I tried the code below, but it did not work.  Could that be because I'm skinning the gridview?

<telerik:GridViewDataColumn.GroupHeaderTemplate>
     <DataTemplate>
          <TextBlock Text="{Binding Group.Key}" Visibility="Hidden"/>
     </DataTemplate>
</telerik:GridViewDataColumn.GroupHeaderTemplate>
0
Dimitrina
Telerik team
answered on 09 Jul 2012, 11:18 AM
Hi,

 I have checked the demo and there is something missing there. You should hide the header aggregates for the GridViewGroupRow:

<telerik:RadGridView.GroupRowStyle>
   <Style TargetType="telerik:GridViewGroupRow">
         <Setter Property="ShowHeaderAggregates" Value="False"></Setter>
      </Style>
</telerik:RadGridView.GroupRowStyle>

Then you should be able to  hide the group aggregates for some columns.

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Ben
Top achievements
Rank 1
answered on 17 Jul 2012, 08:05 PM
When I do this, it hides ALL of the aggregate headers.  How do I add some of them back while keeping others hidden?

Thank you.
0
Dimitrina
Telerik team
answered on 18 Jul 2012, 01:15 PM
Hi,

 You are right. After you set the ShowHeaderAggregates, then the header aggregates will not be shown any more.
You should define a GroupHeaderTemplate for each column where you would like to show the aggregated value back.

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ben
Top achievements
Rank 1
answered on 18 Jul 2012, 09:29 PM
I'm using the method you describe above to hide the header and the following code to add headers back

<telerik:GridViewDataColumn.GroupHeaderTemplate
     <DataTemplate
          <TextBlock Text="{Binding Group.Key}"
     </DataTemplate
</telerik:GridViewDataColumn.GroupHeaderTemplate>

This is not working for me.  I still get no headers at all.  Can you tell me what I'm doing wrong?
0
Dimitrina
Telerik team
answered on 19 Jul 2012, 02:05 PM
Hi,

So you would like to hide some aggregate results (not just group headers) in the group header and show other. Please excuse me for this misunderstanding. 

You cannot just hide some of them, but I have prepared a sample project on how you could remove the AggregateResults you do not like to be shown.

Please find it attached for a reference.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Ben
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Ben
Top achievements
Rank 1
Share this question
or