zoukankan      html  css  js  c++  java
  • dev gridcontrol checkbox

     private void simpleButton1_Click(object sender, EventArgs e)
            {
                string strConn = "Data Source=xxx; User ID=xfx; Password=sd";
                OracleConnection oconn = new OracleConnection(strConn);
                string strComm = "select * from ESSTICKETTYPE";
                OracleDataAdapter oda = new OracleDataAdapter(strComm, oconn);
                DataSet ds = new DataSet();
                try
                {
                    oda.Fill(ds, "cx");
                    ds.Tables["cx"].Columns.Add("check", System.Type.GetType("System.Boolean"));
    
                    gridControl1.DataSource = ds.Tables["cx"];
                    
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
    
                }
                finally
                {
                    oconn.Close();
    
                }
            }
    
     private void simpleButton2_Click(object sender, EventArgs e)
            {
    
                if (this.simpleButton2.Text=="全选")
                {
                    this.simpleButton2.Text = "全选取消";
                    for (int i = 0; i < gridView1.RowCount; i++)
                    {
                        gridView1.SetRowCellValue(i, "check", true);
                    }
    
                }
                else
                {
                    this.simpleButton2.Text = "全选";
                    for (int i = 0; i < gridView1.RowCount; i++)
                    {
                        gridView1.SetRowCellValue(i, "check", false);
                    }
                }
    
    
    
            }
    
  • 相关阅读:
    gitlab+gerrit+jenkins持续集成框架
    多线程自动翻页爬虫
    爬虫超级简单入门
    完整开发流程管理提升与系统需求分析过程 随堂笔记(day 1) 【2019/10/14】
    Logistic Regression
    cmdb项目-2
    cmdb项目-3
    cmdb全总结
    crm-1
    crm-2
  • 原文地址:https://www.cnblogs.com/BrianLee/p/2781051.html
Copyright © 2011-2022 走看看