使用DataGrid的过程中常会用到CheckBox控件,并使用它的CheckedChanged事件。使用如下:

1、CheckBox控件需要设置AutoPostBack="true"
DataGrid中使用CheckBox的CheckedChanged事件<asp:CheckBox id="chbIsActive" runat="server" AutoPostBack="true"></asp:CheckBox>

2、CheckBox控件的事件须在DataGrid的ItemCreated定义才能生效
DataGrid中使用CheckBox的CheckedChanged事件        private void grdStructure_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
        }

3、编写事件代码
DataGrid中使用CheckBox的CheckedChanged事件        private void chbIsActive_CheckedChanged(object sender, EventArgs e)
        }

相关文章:

  • 2022-12-23
  • 2021-09-14
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-05-19
相关资源
相似解决方案