winform 下的datagrid问题

tinyghost 2003-03-25 04:02:40
建立一个windows项目,在一个form上添置一个datagrid控件,我想让某列下面的内容编程复选框的形式,怎么实现啊,我这里没有看到属性生成器,如何实现
...全文
19 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lbx1979 2003-03-26
  • 打赏
  • 举报
回复
/* Create a new DataGridTableStyle and set
its MappingName to the TableName of a DataTable. */
DataGridTableStyle ts1 = new DataGridTableStyle();
ts1.MappingName = "Customers";

/* Add a GridColumnStyle and set its MappingName
to the name of a DataColumn in the DataTable.
Set the HeaderText and Width properties. */

DataGridColumnStyle boolCol = new DataGridBoolColumn();
boolCol.MappingName = "Current";
boolCol.HeaderText = "IsCurrent Customer";
boolCol.Width = 150;
ts1.GridColumnStyles.Add(boolCol);

myDataGrid.TableStyles.Add(ts1);
seaAsky 2003-03-26
  • 打赏
  • 举报
回复
gz
tinyghost 2003-03-25
  • 打赏
  • 举报
回复
怎么做模版列?用什么方法??
yuying 2003-03-25
  • 打赏
  • 举报
回复
用模板实现 。
将你所要放复选框的那一列作为模板列,然后编辑此模板列(即在此列中放入复先框)即可。

110,567

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧