我的 asp.net 网络表单中有一个 Telerik RadGrid,如下所示:
MasterTableView
DetailTables -> GridTableView
在那个详细表中,我有一列如下所示:
<telerik:GridTableView runat="server" DataKeyNames="ID,Customer_ID,CardType_ID,OrderStatus_ID"
DataSourceID="sdsOrders" AllowFilteringByColumn="True"
AllowMultiColumnSorting="True" AllowSorting="True" ShowFooter="True" OnDataBinding="GridTableView_DataBinding">
...
<telerik:GridBoundColumn DataField="TotalPrice" DataType="System.Int32" FilterControlAltText="Filter TotalPrice column"
HeaderText="TotalPrice" SortExpression="TotalPrice"
UniqueName="TotalPrice" AllowFiltering="False" FooterText="Sum: " Aggregate="Sum">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="100px" />
</telerik:GridBoundColumn>
我想更改页脚文本(总和)和页脚中的(总和)的颜色。
对于 MasterTableView 中的 DataBoundColumns,以下代码有效:
protected void GridTableView_DataBinding(object sender, EventArgs e)
{
GridBoundColumn TotalPrice = grdCustomers.MasterTableView.GetColumnSafe("TotalPrice") as GridBoundColumn;
TotalPrice.FooterAggregateFormatString = "<span class=\"AggregateTitleColor\">Sum : </span>" + "{0:#,0 ;#,0- }";
TotalPrice.FooterStyle.ForeColor = ColorTranslator.FromHtml("blue");
}
现在我怎样才能在 DetailTable 中为 TotalPrice 重写这些代码?
提前致谢