且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何防止动态添加表的行消失

更新时间:2023-12-02 08:23:46

[基于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: