zoukankan      html  css  js  c++  java
  • dataGridView DataGridViewCheckBoxColumn 列的选择与反选择


     注意设置 DataGridViewCheckBoxColumn 列的TrueValue 和 FalseValue 值分别为  true,false

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
            

              
                
    if (e.RowIndex!=-1)
                
    {
                    
    bool t = false;
                    
    if (this.dataGridView1.Rows[e.RowIndex].Cells[0].Value != null)
                    
    {
                        t 
    = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString()=="true"?true:false;
                         t 
    = !t;
                        
    this.dataGridView1.Rows[e.RowIndex].Cells[0].Value = t;
                    }

               }

            }
  • 相关阅读:
    敌兵布阵
    Points on Cycle
    Hero
    E~最少拦截系统
    C
    A
    J
    H
    G
    A
  • 原文地址:https://www.cnblogs.com/gwazy/p/1114442.html
Copyright © 2011-2022 走看看