Hi,
Is it possible to set the value of tri-state box to following:
0 - Unchecked
1- Checked
2- Grayed Box
3-Checked
Note: As of this moment, I can only display the Grayed Box when I set the value to DBNull.Value.
Regards,
Njel
Hi Njel,
I'm not sure I understand what you are asking. Can you explain in a little more detail?
Hi Mike,
Tri-state checkbox has three state which are the following.
Checked,Unchecked and Grayed Box.
To be able to display all of these states we have to set following values to the tri-state checkbox.
0 to display Unchecked state
1 to display Checked state
DBNull.Value to display Grayed box state.
Is it possible to set value=2 of tri-state checkbox and display Grayed Box?
Note: Grayed box is the state between checked and unchecked.
Ok. That's what I figured. Thanks!
I don't think there is any easy way to do this. You can try trapping the CellChange event. Inside the event, the Value property of the cell will return the original value (it hasn't been updated, yet). and the Text property will return text indicating the new state that the grid will be setting the value to.
So you could examine the two values and then set the Value again to what you want. I'm not sure how well this would work, though.
Mike, is it possible to change the order that a tri-state checkbox cycles through when clicked?
For example, if I set a checkbox to initially have the Indeterminate state, it goes from Indeterminate -> Unchecked -> Checked -> Indeterminate
I would like to be able to go from Indeterminate -> Checked -> Unchecked -> Indeterminate. Is this possible?
Thank you for the information, this really help me a lot.
Thanks for the sample code, this is exactly what I am looking for.
Thanks and regards,