【问题标题】:How to update a textbox in asp.net gridview dynamically如何动态更新asp.net gridview中的文本框
【发布时间】:2023-04-09 19:32:01
【问题描述】:

我在 gridview 中有两列。 一个是文本框,另一个也是文本框。

如果一个文本框文本发生了变化,我需要执行一些计算并再次需要 自动填充第二个文本框。

(例如)如果在第一个文本框中输入 10,我需要执行一些计算并再次得到结果 输入文本后,该操作需要自动显示在文本框中 在第一个文本框中。

我没有办法实现这一点..

请帮帮我。

【问题讨论】:

    标签: c# asp.net gridview textbox


    【解决方案1】:

    您需要处理第一个TextBox TextBox1Leave事件。

    试试这个:

    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
    }
    

    【讨论】:

    • 感谢您的回复。我再次需要更新同一行中的其他文本框值。如何实现?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多