7 Answers, 1 is accepted
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.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
<
telerik:GridViewDataColumn.GroupHeaderTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Group.Key}"
Visibility
=
"Hidden"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.GroupHeaderTemplate
>
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.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thank you.
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.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
<
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?
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.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.