I tried searching these forums, but the search feature is NOT working, so no results are ever returned no matter what you search for.
I have an UltraGrid and have tried a few approaches to adding a TriStateCheckBox to a column. However, the intermediate state is never triggered, it only accepts checked or unchecked. The underlying bit value is nullable.
So far I have tried setting the column style to TriStateCheckBox and I have tried adding an UltraCheckEditor with ThreeState set to true as an EditorComponent.
The bit field was not nullable at first, but I updated the table to make it nullable and set a few records to null. I'm pretty sure the data is being passed in as null, but that just sets it as unchecked. Clicking the checkbox only uses checked or unchecked.
Any guidance or advice would be appreciated. Thank you.
Hello Sam,
Thank you for your updates on this matter. I am glad you were able to get this to work by setting the cell value to null.
Regarding using the tri-state checkbox without having the underlying data field be nullable, this is not currently possible, as the checkbox editor is meant to display bool values and the “third state” means that the underlying value of the cell is neither true nor false. As such, the underlying data field must be nullable to allow null values and the third state.
Please let me know if you have any other questions or concerns on this matter.
Is there a way to use a tri-state checkbox without having the underlying data field be nullable? I just want to use it as an indicator for something and not necessarily as a data value.
I got it to work by setting the cell value to NULL. The way it was working it was not allowing nullable values for that field.
Sorry for the late reply, I'm not getting notifications.
I tried what was mentioned in that article. I tried the following so far. In both instances, I get only the checked and unchecked states. What data type should the column field be? I have it set as a nullable boolean.
column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.TriStateCheckBox;
and
UltraCheckEditor checkEditor = new UltraCheckEditor{ ThreeState = true,};
column.EditorComponent = checkEditor;
My apologies about the search functionality in the forums at the moment. I will bring this up to our internal teams so they can investigate.
Regarding the three-state checkbox in the UltraGrid, I would recommend taking a look at the following forum thread where an example exists that demonstrates how to achieve this: https://ko.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/62098/tri-state-editor.