本文介绍了如何查看datagridview列中的复选框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我的问题是我在数据网格视图中添加了复选框列,使用c#。

但是复选框不能正常工作就像,它不是点击这样我怎么能添加它在数据网格视图的特定列和行中正常工作的复选框。

这是我的C#代码: -

DataGridViewCheckBoxColumn CheckboxColumn = new DataGridViewCheckBoxColumn();

CheckBox chk = new CheckBox();

CheckboxColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

dataGridView1。 Columns.Add(CheckboxColumn);

CheckboxColumn.DisplayIndex = 1;

CheckboxColumn.HeaderText =选择;



我如何添加特定的行和列?



我尝试过:



如何使用c#在数据网格视图中的特定行和列中添加复选框?

Hello,
My problem is i have added check box column,n in data grid view using c#.
but check box can't work Like, its not clicking so how can i add check box that its work properly in particular column and row of data grid view.
Here is my code of C#:-
DataGridViewCheckBoxColumn CheckboxColumn = new DataGridViewCheckBoxColumn();
CheckBox chk = new CheckBox();
CheckboxColumn.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridView1.Columns.Add(CheckboxColumn);
CheckboxColumn.DisplayIndex = 1;
CheckboxColumn.HeaderText = "Select";

how can i add in particular row and columns?

What I have tried:

how can i add check box in particular rows and columns in data grid view using c#?

解决方案
var column = new DataGridViewCheckBoxColumn();
column.HeaderText = "Abc";
column.Name = "Abc";
dataGridView1.Columns.Insert(0, column);





否则,您的datagridview可能还有另一种格式......



Otherwise, probably you have another formatting for your datagridview...


这篇关于如何查看datagridview列中的复选框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 11:38