DataGridView添加复选框并向其中绑定值
//DataGridview绑定数据
public void DataGridViewBandingData()
{ string year = this.CMB_year.SelectedValue.ToString(); //年份
string leibie = ((CListItem)this.CBXLeiBie.SelectedItem).Id; //类别
string bianhaoquan = this.txtBianhaoquan.Text; //编号权
string shixiangmingcheng = this.txtshixiangmingcheng.Text; //事项名称
string farendaima = this.txtfarendaima.Text; //法人代码 DataSet ds = bll.GetJiChuShuJu(leibie, year, bianhaoquan, shixiangmingcheng, farendaima); DataGridViewCheckBoxColumn myCol = new DataGridViewCheckBoxColumn(); //创建复选框
myCol.Selected = false;
this.DataGridView.Columns.Add(myCol); this.DataGridView.ColumnCount = ; //指定列数
this.DataGridView.ColumnHeadersVisible = true; //是否显示猎头 this.DataGridView.AutoGenerateColumns = false; this.DataGridView.Columns[].HeaderText = "全选";
this.DataGridView.Columns[].DataPropertyName = ""; //ds.Tables[0].Columns["HangBiaoShi"].ToString()
this.DataGridView.Columns[].Width = ; this.DataGridView.Columns[].HeaderText = "年份";
this.DataGridView.Columns[].DataPropertyName = ds.Tables[].Columns["BianHaoNian"].ToString(); this.DataGridView.Columns[].HeaderText = "编号权";
this.DataGridView.Columns[].DataPropertyName = ds.Tables[].Columns["BianHaoQuan"].ToString();
this.DataGridView.Columns[].Width = ; this.DataGridView.Columns[].HeaderText = "事项名称";
this.DataGridView.Columns[].DataPropertyName = ds.Tables[].Columns["ShiXiangMingCheng"].ToString();
this.DataGridView.Columns[].Width = ; this.DataGridView.Columns[].HeaderText = "法人代码";
this.DataGridView.Columns[].DataPropertyName = ds.Tables[].Columns["FaRenDaiMa"].ToString(); this.DataGridView.Columns[].HeaderText = "行标示";
this.DataGridView.Columns[].DataPropertyName = ds.Tables[].Columns["HangBiaoShi"].ToString();
this.DataGridView.Columns[].Width = ;
this.DataGridView.Columns[].Visible = true; this.DataGridView.Columns[].HeaderText = "登记标识";
this.DataGridView.Columns[].DataPropertyName = ds.Tables[].Columns["dengjibiaoshi"].ToString();
this.DataGridView.Columns[].Width = ; this.DataGridView.Columns[].HeaderText = "当事人";
this.DataGridView.Columns[].DataPropertyName = ds.Tables[].Columns["dangshiren"].ToString();
this.DataGridView.Columns[].Width = ; this.DataGridView.DataSource = ds.Tables[];
}
DataGridView添加复选框并向其中绑定值的更多相关文章
- datagridview添加复选框全选和取消
全选 private void All_selected_Click(object sender, EventArgs e) { ; i < this.DataGridViewProduct.R ...
- DateGridView标题列头添加复选框
第一:添加列标题时,添加两个空格——用于显示复选框: 第二:实现列标题添加复选框,代码如下: private void AddCheckeBoxToDGVHeader(DataGridView dgv ...
- Qt之QHeaderView添加复选框
简述 前面分享了QTableView中如何添加复选框.本节主要介绍QTableView中的表头-QHeaderView添加复选框的功能,下面以水平表头为例,垂直表头类似! 简述 效果 QHeaderV ...
- 组合框里添加复选框的方法(使用勾选的假象,用图片代替而已,并非QT原生支持)
组合框可以看作是列表框和文本框的组合,因其占据的空间少,使用操作方便,常被界面设计人员用于界面开发设计中,在有限个输入的条件下,组合框常用来代替文本框,这样从用户使用角度来看,更趋人性化,所见即所得. ...
- QListWidget的QComboBox下拉列表添加复选框及消息处理
要在QComboBox下拉列表项中添加复选框,并进行消息处理,在网上搜索了很久没有找到太多有用的信息和实际的例子,但从中还是找到了一些提示性的资料,根据这些简短的介绍,最终实现了这个功能. QComb ...
- 雷林鹏分享:jQuery EasyUI 数据网格 - 添加复选框
jQuery EasyUI 数据网格 - 添加复选框 本实例演示如何放置一个复选框列到数据网格(DataGrid).通过复选框,用户将可以选择 选中/取消选中 网格行数据. 为了添加一个复选框列,我们 ...
- dojo:为数据表格添加复选框
一.添加复选框 此时应该选用EnhancedGrid,而不是普通的DataGrid.添加复选框需要设置EnhancedGrid的plugins属性,如下: gridLayout =[{ default ...
- 三、winForm-DataGridView操作——DataGridView 操作复选框checkbox
一.添加复选框 ArrayList arr = new ArrayList(); public string checkboxName = "选择"; void StandLibW ...
- Jquery Datatable添加复选框,实现批量操作。
最近一段时间,一直在写前端的东西,自己也不擅长,最近也有所长进,把工作中用到的一些前端知识整理一下,下次用到就不用再找了.这次主要是在datatable中添加复选框,然后实现批量操作的功能.因为是公司 ...
随机推荐
- linux bugfree 安装
前段时间用了下bugzilla,请参考:linux bugzilla nginx 安装配置 详解,感觉不是很好用.下面说一下,bugfree的安装 bugfree3.0.1是用php的yii框架开发的 ...
- Cleaning Shifts(POJ 2376 贪心)
Cleaning Shifts Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15143 Accepted: 3875 ...
- POJ 2488 A Knight's Journey(DFS)
A Knight's Journey Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 34633Accepted: 11815 De ...
- 利用Azure Automation实现云端自动化运维(3)
Azure automation的认证方式:证书 该种方式是推荐的进行Automation认证的方式,好处在于安全性高,过期时间由自己控制,不好的地方在于大家在Windows上要生成证书比较麻烦, ...
- ubuntu下安装fiddler
因为工作中需要用到fiddler工具 现在工作环境迁移到ubuntu14 下 发现fiddler只支持windows网上也有很多推荐 号称可以代替fiddler 但因为功能使用上比较习惯 并 ...
- 系统service
Context.TELEPHONY_SERVICE TelephonyManager tManager = (TelephonyManager)getSystemService(Context.TEL ...
- 【UVA 11997 K Smallest Sums】优先级队列
来自<训练指南>优先级队列的例题. 题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18702 题意:给定 ...
- 关于随机数字K线极值的统计结果
如果有组随机数字,如数字彩票.我们对号码进行平均二分后,统计期出现的结果分布,对结果分布进行K线累加,得到一条折线. 这条折线的顶点和底点的统计上服从以下规则: 令总期数为N,统计区间为M,则在N期内 ...
- FVANCOP/ChartNew.js
FVANCOP/ChartNew.js FVANCOP/ChartNew.js
- 认识Log4j
Log4j是一个非常强大的log记录软件,下面我们就来看看在项目中如何使log4j. 首先当然是得到log4j的jar档,推荐使用1.2.X版,下载地址: http://logging.apache. ...