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.
The gray box is the Indeterminate state. I was not aware that the TriStateCheckBox state of a column accepted integer values, but if it does, I assume that it will interpret a 0 as false and any other numeric value as true.
You could get around this by using a DataFilter to convert the value 2 into DBNull.Value and vice versa in the OwnerToEditor and EditorToOwner conversions.
Check out the Infragistics Knowledge Base for some sample DataFilters.
Thank you for the information, this really help me a lot.
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?
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.
Ok. That's what I figured. Thanks!