I have a RadGrid with expandable rows, where each expanded NestedViewTemplate
contains a RadGrid. The child RadGrids have a visible footer and a few columns (I've included one, "DtlTransAmount"):
<NestedViewTemplate>
<asp:Panel ID="pnDetailItems" runat="server" >
<telerik:RadGrid ID="rgDetailItems" runat="server" ShowFooter="true" Width="1675px" AutoGenerateColumns="false" AllowPaging="false"
OnItemDataBound="rgDetailItems_ItemDataBound" ... >
<MasterTableView>
<Columns>
<telerik:GridBoundColumn HeaderText="Amount" DataField="DtlTransAmount" UniqueName="DtlTransAmount" SortExpression="DtlTransAmount"
HeaderStyle-Width="20px" ItemStyle-Width="20px" FilterControlWidth="20px" DataFormatString="{0:$0.00}"/>
I set the footer text of each child RadGrid in their ItemDataBound event in the code behind:
private void rgDetailItemsItemDataBound(object sender, GridItemEventArgs e)
{
var foot = e.Item as GridFooterItem;
var r = sender as RadGrid;
foot["DtlTransAmount"].Text = "Total Amount: $" + GetMainSumFromDetailRadGrid(r);
//...
This makes it so every child RadGrid has at the bottom of their "DtlTransAmount" column something like
Total Amount: $10.00
Now I need to adjust this sum value (the "10.00") via JavaScript when any textbox cell in the child RadGrid loses focus (because the user has changed amount values). I can successfully call a function with a single input parameter of the calling object, but them I'm not sure what to do:
function detailAmountUpdate(obj) {
// alert("Made it here at least...");
// no idea what to do now.
}
For example, if I have 3 expanded rows (so 3 child RadGrid's visible) and I unfocus from a textbox in the child RadGrid of the 2nd row, how can I update the labels in the footer of just that child RadGrid? All DOM functions like getElementsByTagName
or Telerik API functions like get_nestedViews
all return empty or undefined or null.