I have a radgrid that uses nested groups by specifying two GridGroupByExpressions on the front-end. Unfortunately, I cannot find an effective way to apply separate GroupHeaderTemplates to each group level. Here's what I've tried:
The GroupByExpressions work just fine, but when I try to add the GroupHeaderTemplates, the following exception is thrown on the second GroupHeaderTemplate: "'System.Data.DataRowView' does not contain a property with the name 'Date'." If I remove the second one, both groups are given the same template (e.g. the nested Date group displays the current GroupName). Is there a way to manage group headers and group subheaders independently?
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldName
=
"GroupName"
/>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"GroupName"
SortOrder
=
"Ascending"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldName
=
"Date"
FormatString
=
"{0:MMMM yyyy}"
/>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"Date"
SortOrder
=
"Ascending"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
GroupHeaderTemplate
>
<
asp:Label
ID
=
"lblGroupName"
runat
=
"server"
Text='<%# Eval("GroupName") %>' />
</
GroupHeaderTemplate
>
<
GroupHeaderTemplate
>
<
asp:Label
ID
=
"lblDate"
runat
=
"server"
Text='<%# Eval("Date") %>' />
</
GroupHeaderTemplate
>
The GroupByExpressions work just fine, but when I try to add the GroupHeaderTemplates, the following exception is thrown on the second GroupHeaderTemplate: "'System.Data.DataRowView' does not contain a property with the name 'Date'." If I remove the second one, both groups are given the same template (e.g. the nested Date group displays the current GroupName). Is there a way to manage group headers and group subheaders independently?