问题标签 [datagridviewcheckboxcell]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
944 浏览

datagridview - C# winforms 4.0 datagridview 多选复选框

多选 DataGridView 和其中的复选框列。我想允许用户检查/取消选中所有选定的行,但是当检查一个复选框时,选择将移动到此行(并且其他行变为未选择)。

问:当用户选中/取消选中复选框时,有什么方法可以防止 DatagridView 中的选择更改?

0 投票
0 回答
2402 浏览

vb.net - VB.NET DataGridViewCheckBoxCell 检查值

我想从 DataGridViewCheckBoxCell 中获取值,
我尝试了各种代码

还使用ctype和cbool和convert.boolean ...当我进入调试时,当我将鼠标光标移到.value上时,它返回“Nothing”

有必要获得它不会返回的正确布尔值......我是否必须在设计时更改复选框单元格的任何设置?

0 投票
2 回答
15697 浏览

c# - DataGridView中的复选框在检查后不会改变它的值

我在 DataGridView 的一列中有复选框。

现在我遇到了一个问题:当我单击Checkbox一次时,它会发生变化,但只是视觉上的,在代码中它的值仍然设置为 false。但是,如果我单击复选框,然后单击 datagridview 上的任何其他位置(或在代码中手动更改其值 true),它会更改其值为 true。

如何在单击后强制我的复选框更改值?(令人讨厌的是检查复选框实际上没有检查它)。

谢谢你的帮助。

0 投票
2 回答
1077 浏览

c# - C# DataBound DataGridView with extra column - changes in this column are lost upon sort?

I use a DataGridView which is data-bound over a binding source. Additionally I create one CheckBoxCol on the very left for the user. Checking boxes in there and then re-sorting makes all checks disappear. Has anyone an idea how to avoid that?

Here's some code so we're on the same page ;):

The DataGridView has no further code as such to get filled, later on of course checkbox clicks and such are handled but that should not be relevant for the issue.

Kinds regards!

0 投票
1 回答
1881 浏览

c# - how to maintain checkbox check status on paging link click in datagridview in C#

I need to create paging in datagridview and I was found a demo in programCall.com successfully and that’s link ProgramCall.com

Below is screen shot of downloaded demo Form:- enter image description here

Now I update this downloaded code and add a check box column in zeroth (0) index of datagridview:-

Below screen shot is update. enter image description here

Here is my question; when I have checked a checkbox in first page and after that move to Second page to perform any task after returning in first page the my checked checkboxes is unchecked, I want to maintain its checked status so any property or method is there to maintain datagridview checkbox checked status or else.

Below I am giving you my updated code:-

Form1.cs:-

Employee.cs:-

Thank You in Advanced!

0 投票
2 回答
11094 浏览

wpf - DataGridTemplateColumn.CellTemplate 中的 wpf 绑定复选框命令

这已经被问过几次不同的变化,但我无法让它们中的任何一个工作。

当在我的视图中单击复选框(在 datagridTemplateColumn.cellTemplate 中)时,我试图在我的视图模型中调用一个方法

在我的视图模型中

0 投票
1 回答
169 浏览

datagridviewcheckboxcell - 无法从表单构造函数中设置 DataGridViewCheckBoxCell.Value

很奇怪的东西。我有一个带有未绑定 CheckBox 列的 DataGridView。当 ComboBox 的选定项发生更改时,DataGridView 会更新它的 DataSource(根据 ComboBox 中选择的内容,这里没有绑定,只是一个条件语句)。更新 DataSource 后,我遍历一个集合并相应地设置 CheckBox 列的值。这工作正常。但是,当我决定尝试在构造函数中设置 ComboBox 的 SelectedItem 以便在加载表单时 ComboBox 中有一个值时,相同的方法无法更新 CheckBox 单元格的状态,即使单步执行调试器显示这些值已设置为 true。

0 投票
2 回答
2390 浏览

vb.net - 将复选框列添加到 DataGridView

我使用 VS 2008 和 VB.NET 作为语言。我有两个网格。在一个网格中,ii 有用户的数据。例如手机号码、电子邮件和其他信息。在第二个网格中,我已经添加了一些警报。

我需要在警报网格视图的每一行中附加两个复选框列。单击该复选框后,将执行特定的数据库操作。

目前,我在 datagridview 中添加了复选框,但无法选中/取消选中它们。

请帮助我解决选中/取消选中问题,并提示我执行复选框单击的数据库操作。

这就是我在datagridview中添加复选框的方式

我试图将列的 readonly 属性设置为 false,但它不起作用。

0 投票
4 回答
14486 浏览

c# - 如何知道datagridview中的特定复选框是否被选中?

我有一个 gridview 有 2 列,一个是文本框列,另一个是复选框列,如何知道选中了哪个复选框。

在此处输入图像描述

如图所示,假设任何一个复选框被选中,我想显示该复选框的相应文本框值。

任何人都可以帮助我吗?我尝试了下面的代码,但我面临的问题是,一旦我点击下一个复选框,值就会显示出来,然后之前选中的复选框值就会显示出来。

0 投票
1 回答
1288 浏览

c# - 更改行/列时,未绑定的复选框列值被清除

我有一个 datagridview 列绑定到数据集。其中一列是未绑定的复选框列。我正在使用 cellPushed 事件来识别对复选框所做的任何更改并且有效。我的问题是我可以选中复选框并让我的功能正常工作,但是如果我选择其他列或行,复选框中的真实值就会消失。

任何想法为什么会这样?