473,385 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DataGridView CheckBox Cell

Using VS 2005.

I have an app that has a DataGridView control. This control has two
columns, the first column is a standard TextBox, and the second column
is a CheckBox.

I am having difficulty determining the state of the CheckBox, whether
it is checked or not. I have identified an event that fires when the
user clicks in the checkbox, CellClick. In that event handler I
declare a local variable of the DataGridViewCheckBoxCell type and set
it to the cell that fired the event with a statement like this:

DataGridViewCheckBoxCell chk;

if (e.ColumnIndex == 1)
chk = datagridview.Rows[e.RowIndex].Cells[e.ColumnIndex];

But the chk.Value property is ALWAYS set whether the checkbox is
checked or not!!!

I have searched the help files but cannot find anything on how to
handle ANY of the DataGridView special cell types. How do I determine
the state of this checkbox cell?

TIA,

Nov 12 '07 #1
1 13700
za***@construction-imaging.com wrote:
Using VS 2005.

I have an app that has a DataGridView control. This control has two
columns, the first column is a standard TextBox, and the second column
is a CheckBox.

I am having difficulty determining the state of the CheckBox, whether
it is checked or not. I have identified an event that fires when the
user clicks in the checkbox, CellClick. In that event handler I
declare a local variable of the DataGridViewCheckBoxCell type and set
it to the cell that fired the event with a statement like this:
[...]

According to the docs
(http://msdn2.microsoft.com/en-us/lib...ckboxcell.aspx)
the value will be either True or False when in simple on/off (binary) mode.

Chris.
Nov 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: michael schindler | last post by:
hi there i have tried do use the new DataGridView of the Framework 2.0. i use the new DataGridViewCheckBoxColumn Somehow i don't know how to read if a checkbox is checked or not. For example in...
2
by: Bob | last post by:
I need to check if there has been a difference between the old value in a call of a datagridview and the new value after the user changed a selection in a combobox in the datagridview. I can find...
2
by: Kiran_Juikar | last post by:
How to add the header checkbox in the datagridview checkbox column? Is there any property available to add a header checkboxor one need to write the custom logic for this?
1
by: Martin | last post by:
Hi, I'm having a problem with a datagridview control when trying to read the value of an unbound checkbox cell. The code below works fine if I click on any text cell, bound or unbound, and...
9
by: obrienkev | last post by:
Hi, I have a Checkbox column in the DataGridView. I am unable to change the state of the checkbox. Why is this??? What do I need to set in Properties? Using Visual Studio 2005
2
by: mrstrong | last post by:
Gday, I have a datagridview that I am creating the columns programatically which all seems to work fine. I have a couple of dropdown boxes, so I have set the editMode= EditOnEnter. Now my...
1
by: QuickBooksDev | last post by:
VB.NET 2005 DataGridView Checkbox - Check Event need to know check status I would like to use the DataGridView Checkbox like a normal checkbox. When someone clicks on it I would expect that I...
2
by: =?Utf-8?B?S2lt?= | last post by:
foreach (DataGridViewRow row in this.dataGridView.Rows) { if (row.Cells.Value.ToString() == "true") { return true; } } return false;
4
by: Benysh | last post by:
Hi everyone. I'm having a really annoying problem I can't solve and couldn't find an answer to anywhere, let's see if you got what it takes. I have a dataGridView on a C# Windows Form. Unbound....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.