源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

实现DataGridView控件中CheckBox列的使用实例

  • 时间:2022-05-28 10:46 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:实现DataGridView控件中CheckBox列的使用实例
[u]复制代码[/u] 代码如下:
/// <summary>         /// 实现DataGridView控件中CheckBox列的使用         /// </summary>         /// <param name="sender"></param>         /// <param name="e"></param>         private void dgvTradList_CellContentClick(object sender, DataGridViewCellEventArgs e)         {             if (e.ColumnIndex == 0 && e.RowIndex != -1)             {                 if ((bool)dgvTradList.Rows[e.RowIndex].Cells[0].EditedFormattedValue == true)                 {                     dgvTradList.Rows[e.RowIndex].Cells[0].Value = false;                 }                 else                 {                     dgvTradList.Rows[e.RowIndex].Cells[0].Value = true;                 }             }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部