简体   繁体   English

如何动态更新asp.net gridview中的文本框

[英]How to update a textbox in asp.net gridview dynamically

I have two columns in gridview. 我在gridview中有两列。 One is textbox and the other is also a textbox. 一个是文本框,另一个也是文本框。

If one textbox text changed , i need to perform some calculation and again need to fill automatically the second textbox. 如果一个文本框的文本更改了,我需要执行一些计算,然后再次需要自动填充第二个文本框。

(eg) Ifi enter 10 in 1st textbox, i need to perform some calculation and again the result of that manipulation needs to shown in the textbox automatically once the text is entered in the first textbox. (例如)如果在第一个文本框中输入10,则我需要执行一些计算,并且一旦在第一个文本框中输入了文本,该操作的结果就需要自动在文本框中显示。

I am not getting a way to achieve this.. 我没有办法实现这一目标。

please help me. 请帮我。

You need to handle the Leave Event of the first TextBox TextBox1 . 您需要处理第一个TextBox TextBox1Leave事件。

Try This: 尝试这个:

textBox1.Leave += new System.EventHandler(textBox1_Leave);
private void textBox1_Leave(object sender, EventArgs e)
{
      //Do calculations on TextBox1 value to display the result on TextBox2
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM