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;
                    }

               }

            }
  • 相关阅读:
    第一章
    第三章
    第四章
    第十章 读书笔记
    第八章 读书笔记
    第九章 读书笔记
    第7章实验心得
    第六章实验心得
    第五章心得体会
    第四章实验心得
  • 原文地址:https://www.cnblogs.com/gwazy/p/1114442.html
Copyright © 2011-2022 走看看