如何防止动态添加表的行消失 [英] How to prevent disappearing of dynamically added rows of a table

查看:94
本文介绍了如何防止动态添加表的行消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何防止在该行的TextBoxes的AutopostBack中使用TexBoxes动态添加表的行消失。

解决方案

[基于OP的评论]

你必须添加像这样的textchanged事件

 txtbox.TextChanged + = new EventHandler(txtbox_TextChanged); // txtbox是动态生成的文本框



正常实施

  private   void  txtbox_TextChanged( object  sender,EventArgs e)
{
// 您的代码在这里
}



问候......:笑:


How to prevent disappearing of dynamically added rows of a table with TexBoxes in the AutopostBack of TextBoxes in that row.

解决方案

[Based on OP's comments]
You have to add textchanged event like this

txtbox.TextChanged += new EventHandler(txtbox_TextChanged);//txtbox is dynamically generated textbox


Implement it as normal

private void txtbox_TextChanged(object sender, EventArgs e)
    {
        //your code goes here
    }


Regards..:laugh:


这篇关于如何防止动态添加表的行消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆