Usually it can be done in TextChanged event of the TextBox1 in second column. But I am not sure it will be practical as the textchanged event will fire Only when the control looses its focus. Anyway try Yourself.
GoodLuck
Kindly mark this post as "Answer", if it helped you.
solarissf
0 Points
60 Posts
Re: Make 1 column in gridview editable for user
May 02, 2012 05:50 PM|LINK
works! and now final question. I need the total/footer to update everytime the user changes a textbox value. sorry for all this, I know its alot
basheerkal
Star
10672 Points
2426 Posts
Re: Make 1 column in gridview editable for user
May 02, 2012 05:58 PM|LINK
Usually it can be done in TextChanged event of the TextBox1 in second column. But I am not sure it will be practical as the textchanged event will fire Only when the control looses its focus. Anyway try Yourself.
GoodLuck
(Talk less..Work more)
solarissf
0 Points
60 Posts
Re: Make 1 column in gridview editable for user
May 02, 2012 05:59 PM|LINK
thanks for all your help.. much appreciated!
solarissf
0 Points
60 Posts
Re: Make 1 column in gridview editable for user
May 02, 2012 06:40 PM|LINK
thanks again for everything... with your help I made on Textbox1
onchange= "javascript:Add();">
<script type="text/javascript">
function
Add()
{
var gv = document.getElementById("<%= UserAllocationGrid.ClientID %>"
);
var tb = gv.getElementsByTagName("input");
//this is percentage column
var lb = gv.getElementsByTagName("span"
);
var
total = 0;
for (var
i = 0; i < tb.length; i++) {
if (tb[i].type == "text"
) {
total = parseFloat(tb[i].value) + total;
}
}
lb[lb.length -1].innerHTML = total;
}
</
script
>