Posted 5 June 2018, 5:10 pm EST - Updated 4 October 2022, 2:34 am EST
ComponentOne Studio for WinForms (.NET 4.0) 4.0.20173.286 2019.V1 4.0.20181.307 4.0.20181.307
Seeing these exceptions when attempting to set check boxes in the grid programmatically:
Exception: Exception thrown: ‘System.NotSupportedException’ in System.dll (“StringConverter cannot convert from System.Boolean.”). Exception thrown: ‘System.NotSupportedException’ in System.dll (“StringConverter cannot convert from System.Boolean.”)
The exceptions are caught, however it takes a really long time to check all the row boxes because of them. Is this a known issue? if so, is there are workaround?
Here’s the code to check the boxes:
grid.BeginUpdate() For row = grid.Rows.Fixed To grid.Rows.Count - 1 grid.SetCellCheck(row, 0, checkState) Next grid.EndUpdate()
Happens with or without the Begin/End Update.
I don’t get the same errors if I set the column data type to object, but as soon as I add data I get the true/false labels, which is no good for me. Thanks.