473,480 Members | 1,576 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ThreeState check box

36 New Member
I have a DataGridView that has columns with a value type of boolean.

To load the DataGridView, I load values into a DataTable then set
Expand|Select|Wrap|Line Numbers
  1. theDataGridView.DataSource = theTable
What value can I use in the table to load an intermediate check state?
Would it be better to use a check box control with a value than to use a column set to the boolean data type?

The check box is for display only, and will not need to be changed.
Jul 31 '09 #1
6 5677
Plater
7,872 Recognized Expert Expert
If it doesn't need to be changed, and the column is boolean, shouldn't you only need true/false ?
Jul 31 '09 #2
Infog
36 New Member
There are three states that I would like to show - The employee doesn't have a certain certification (False), the employee does have a certain certification (True), or the employee has a certification that has been flagged for review (Intermediate).

I was hoping that a data table could be used to store the value of an intermediate check state. That would allow me to not manually add each check box column in the DataGridView. If the boolean column in the data table is not recognized as needing three-state check boxes, I may skip using the table and add every column/row directly to the DataGridView.
Jul 31 '09 #3
Plater
7,872 Recognized Expert Expert
Why not use an integer column? 0,1,-1?
Or even a simple text "CERT" "FLAG" "NOCERT"
Jul 31 '09 #4
Infog
36 New Member
I hadn't really thought about using text... it would look nicer if it were check boxes though.

I've been learning a lot of useful things about DataGridViews along the way, so I think I'll keep working towards my goal of using a three-state check box to show the summary of my data.

At least now I know one method that will NOT work. :)
Jul 31 '09 #5
Plater
7,872 Recognized Expert Expert
Hmm, if you have a checkbox column, somewhere in there is like the underlying datatype (a checkbox)
if you can get to that object, you can set it to be a tri-state checkbox maybe?
Jul 31 '09 #6
cloud255
427 Recognized Expert Contributor
Well you could always create a custom control that has three states.

You can then use a nullable Boolean value to represent the states. This will also allow you to map directly to a Boolean field in your database (Many databases consider a boolean to have 3 states: true, false and null).

You declare a nullable Boolean like this:

Expand|Select|Wrap|Line Numbers
  1. Nullable<bool> MyThreeStateBool;
But I agree with Plater that a bool is probably not the best data type to use, a combo box would be far less of a hassle to implement.
Aug 1 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

17
4157
by: Craig Bailey | last post by:
Someone please explain what alternate universe I fell into this afternoon when PHP started telling me that 2 doesn't equal 2. Not sure about you, but when I run this, it tells me 59001.31 doesn't...
7
29841
by: Tony Johnson | last post by:
Can you make a check box very big? It seems like when you drag it bigger the little check is still the same size. Thank you, *** Sent via Developersdex http://www.developersdex.com ***...
2
27706
by: Travis.Box | last post by:
I have an MS Access userform with 16 Check Boxes. Each of the checkboxes has a different option value, which coincides with the Check Box name (eg. cb01.OptionValue = 1). At the bottom of the...
3
3865
by: Steven | last post by:
How can I disable the ThreeState of a checkbox in a datagrid datacolumn (dataset)? Because of the ThreeState the checkboxes in my datagrid can be in the states 'Checked', 'Unchecked', and...
30
4508
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
1
4239
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will...
2
3576
by: Chris Davoli | last post by:
How do you enable a check box in the GridView. I selected Checkbox Field in the Columns of the GridView, and the check box shows up in the Grid view, but it is disabled. How do I enable it so I can...
16
5629
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
5
11626
by: starke1120 | last post by:
Im creating a check in – check out database for RF guns. I have a table that contains models. ID (primary key) Model A table that contains Gun Details ID (primary key) Model_id...
0
7045
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.