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

Sum Footer in RadGrid

1 Answer 51 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Amanda
Top achievements
Rank 1
Amanda asked on 05 Nov 2010, 03:47 PM
Okay - I am updating a textbox named txtRequested which is then updating a textbox named txtVariance in the same row.  When txtVariance is changed the OnChangeValue is fired and I need to now update the footer with the new value.  footer = footer + newValue.  How can I do this in javascript? 

This is the code I am using to get the variance:

function

 

Variance(sender, args)

 

{

 

var rdgrid = $find("<%=RadGrid1.ClientID %>");

 

 

var cell = sender.get_element().parentNode.parentNode;

 

 

var index = cell.parentNode.rowIndex;

 

 

var MasterTable = rdgrid.get_masterTableView();

 

 

var row = MasterTable.get_dataItems()[index - 2]; //getting row

 

 

var tbxAdopted = row.findControl("tbxAdopted").get_value(); //getting value of TextBox 'tbxAdopted'

 

 

var tbxReq = row.findControl("tbxReq").get_value();

 

 

var Variance = tbxReq - tbxAdopted;

 

 

var tbxVariance = MasterTable.get_dataItems()[index - 2].findControl("tbxVar");

 

tbxVariance.set_value(Variance);

}

this gets the value of the textbox changed in the variance column:

 

var

 

newInput = 0.0;

 

 

function VarianceTotal(sender, args) {

 

newInput = sender.get_value();

}



Thanks for your help.

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 10 Nov 2010, 09:42 AM
Hi Amanda,

Thank you for contacting us and for your question.

Please, take a look at the following online example - it should give you directions as to how to achieve your own scenario.

Hope this information will prove helpful. 

Regards,
Tsvetoslav
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
Ajax
Asked by
Amanda
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or