Hi,
Iam using Radgrid for ASP.NET project.
In my grid i have 3 textbox column
for Qty,Price and Total Amont as textbox.
Using clientscript i do calculate on Qty*Price textbox value and update the result in Total Amount text box.
upto this its works fine.
but when i click some button ,using Pagin or during postback the new changed value is not displaying.
My code:
in Item data Bound:
txtQty.Attributes.Add("onFocusout", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");
txtamnt.Attributes.Add("onFocusout", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");
txttotamnt.Attributes.Add("onfocus", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");
and my javascript.
function calculate(cntl1, cntl2, cntl3,rowindex)
{
var text1 =$find(cntl1);
var text2 =$find(cntl2);
var text3 = $find(cntl3);
// alert(rowindex);
var total = text1.get_value() * text2.get_value();
text3.set_value(total);
radGrid.MasterTableView.get_dataItems()[rowindex].get_cell("displayAmnt").innerHTML = total;
}
how to achive textbox Value change value using client side and presist the value.
Iam using Radgrid for ASP.NET project.
In my grid i have 3 textbox column
for Qty,Price and Total Amont as textbox.
Using clientscript i do calculate on Qty*Price textbox value and update the result in Total Amount text box.
upto this its works fine.
but when i click some button ,using Pagin or during postback the new changed value is not displaying.
My code:
in Item data Bound:
txtQty.Attributes.Add("onFocusout", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");
txtamnt.Attributes.Add("onFocusout", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");
txttotamnt.Attributes.Add("onfocus", "return calculate('" + txtQty.ClientID + "','" + txtamnt.ClientID + "','" + txttotamnt.ClientID + "'," + index + ")");
and my javascript.
function calculate(cntl1, cntl2, cntl3,rowindex)
{
var text1 =$find(cntl1);
var text2 =$find(cntl2);
var text3 = $find(cntl3);
// alert(rowindex);
var total = text1.get_value() * text2.get_value();
text3.set_value(total);
radGrid.MasterTableView.get_dataItems()[rowindex].get_cell("displayAmnt").innerHTML = total;
}
how to achive textbox Value change value using client side and presist the value.