I have a Grid that allows users to enter numbers in all the rows and displays the totals at the bottom. To achieve this I used a GridTemplateColumn with RadNumericTextBox textbox in it. It itemtemplate is shown below
<ItemTemplate>
<telerik:RadNumericTextBox ID="Number" runat="server" MinValue="0" MaxValue="1800000000" NumberFormat-AllowRounding="true" Width="90px" NumberFormat-DecimalDigits="0" Skin="Office2007" OnTextChanged="Number_TextChanged" AutoPostBack="true"></telerik:RadNumericTextBox>
</ItemTemplate>
On the textchanged event I loop through all the rows and calculate the total at follows
foreach (GridDataItem gr in radGrid1.MasterTableView.Items)
{
RadNumericTextBox Number = (RadNumericTextBox)gr.FindControl("Number");
lTotal += long.Parse(Math.Round(Number.Value.Value, 0).ToString());
}
and then I display it in the footer as follows:
radGrid1.MasterTableView.Columns[8].FooterText = string.Format("{0:0,000}",lTotal );
This does not update the footer text. Please help.
<ItemTemplate>
<telerik:RadNumericTextBox ID="Number" runat="server" MinValue="0" MaxValue="1800000000" NumberFormat-AllowRounding="true" Width="90px" NumberFormat-DecimalDigits="0" Skin="Office2007" OnTextChanged="Number_TextChanged" AutoPostBack="true"></telerik:RadNumericTextBox>
</ItemTemplate>
On the textchanged event I loop through all the rows and calculate the total at follows
foreach (GridDataItem gr in radGrid1.MasterTableView.Items)
{
RadNumericTextBox Number = (RadNumericTextBox)gr.FindControl("Number");
lTotal += long.Parse(Math.Round(Number.Value.Value, 0).ToString());
}
and then I display it in the footer as follows:
radGrid1.MasterTableView.Columns[8].FooterText = string.Format("{0:0,000}",lTotal );
This does not update the footer text. Please help.