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

RadGrid with Grouping - Group Footers

1 Answer 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 15 Jul 2010, 03:50 PM
Hello,

I have a rad grid with grouping.  My group totals show but I cannot get the FooterText for the group and the Footer style for the group. 


<

 

 

telerik:RadGrid ShowGroupPanel="true" AllowSorting="true" AutoGenerateColumns="false" ShowFooter="true" ID="gridPayCode" runat="server"

 

 

 

onneeddatasource="gridPayCode_NeedDataSource">

 

 

 

<MasterTableView ShowGroupFooter="true">

 

 

 

<Columns>

 

 

 

 

<telerik:GridBoundColumn DataField="facility_site_num" HeaderText="Site#"></telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn FooterText="Total:" FooterStyle-Font-Bold="true" FooterStyle-HorizontalAlign="Right" DataField="FacilityName" HeaderText="Facility"></telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn Aggregate="Sum" FooterStyle-HorizontalAlign="Right" FooterStyle-Font-Bold="true" DataFormatString="{0:c}" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" DataField="PayAmount" HeaderText="Amount"/>

 

 

 

 

</Columns>

 

 

 

<GroupByExpressions>

 

 

 

<telerik:GridGroupByExpression>

 

 

 

<GroupByFields>

 

 

 

<telerik:GridGroupByField FieldName="PayCode" />

 

 

 

</GroupByFields>

 

 

 

<SelectFields>

 

 

 

<telerik:GridGroupByField FieldName="PayCode" HeaderText="Pay Code" />

 

<%

 

--<telerik:GridGroupByField Aggregate="Sum" FormatString="{0:c}" FieldName="PayAmount" HeaderText="Total" />--%>

 

 

 

</SelectFields>

 

 

 

</telerik:GridGroupByExpression>

 

 

 

</GroupByExpressions>

 

 

 

 

</MasterTableView>

 

</

 

 

telerik:RadGrid>

 

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 20 Jul 2010, 02:20 PM
Hello Eric,

Please use the following code to the access the GridFooterItem:
private void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if(e.Item is GridFooterItem)
 {
    GridFooterItem footerItem = e.Item as GridFooterItem;
    //...
 }
}

For additional information, you can take a look at the Totals in grid footers help topic.

Best wishes,
Mira
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
Grid
Asked by
Eric
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or