|
-
Feb 11th, 2011, 10:46 AM
#1
[RESOLVED] DataGridViewCheckBoxCell...
Hi all.
How do I get the value of checkboxcell in DataGridView control?
the value,TrueValue,FalseValue always return as null...
in the column I set the TrueValue to "true" and the FalseValue to "false"
this is the first time i'm trying to access this control so I must doing something wrong here.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Feb 11th, 2011, 10:49 AM
#2
Re: DataGridViewCheckBoxCell...
You don;t need to set the TrueValue and FalseValue because they will be True and False by default. It's only if you want something other than those defaults, e.g. "Yes" and "No", that you need to set them explicitly. As for getting the value, just like every other cell in a DataGridView, it's the Value property yo want. If you aren't getting the correct data then you must be doing it wrong. As you haven't shown us what you're doing, we can't say what that might be.
-
Feb 11th, 2011, 10:52 AM
#3
Re: DataGridViewCheckBoxCell...
the Value Property of the cell is always null, I try to get the value from the CellClick event..
now that I think about it, do I get the value of the cell and not of the CheckBox Control?
is there click event for the DataGridViewCheckbox control? I will check it now.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Feb 11th, 2011, 11:00 AM
#4
Re: DataGridViewCheckBoxCell...
Ok, got it working.
Thanks.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
-
Feb 11th, 2011, 11:00 AM
#5
Re: [RESOLVED] DataGridViewCheckBoxCell...
There is no CheckBox control. The cell simply contains a rendering of a check box.
What do I always say? Read the documentation.
If you want to respond immediately when users click a check box cell, you can handle the DataGridView.CellClick event, but this event occurs before the cell value is updated.
-
Feb 11th, 2011, 11:07 AM
#6
Re: [RESOLVED] DataGridViewCheckBoxCell...
Yes John I agree and trust me I'm doing a lot of reading, but sometimes you just needs to get the job done as fast as you can and move on. (and this is exactly one of those time ehe)
The problem was that I didn't set the DataGridViewCheckBoxCell default value when I initialize it.
* Rate It  If you Like it
__________________________________________________________________________________________
" Programming is like sex: one mistake and you’re providing support for a lifetime."
Get last SQL insert ID 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|