I have a checkbox in an UltraGrid cell. It works fine and changes the value for the row object. However, I need to be able to display the checkbox as checked, without actually changing the underlying value of the row object. I have tried the following with no success.
This does not work and the checkbox remains unchecked.
((CheckEditor)e.Cell.EditorResolved).CheckState = CheckState.Checked;
This throws an error (Internal error: owner arg should never be null)
((CheckEditor)e.Cell.EditorResolved).Value = true;
The only thing that works changes the underlying value to True which I'm trying to avoid.
e.Cell.Value == true
Hello Sam,
I’m glad that you were able to resolve your issue.
Thank you for choosing Infragistics.
Regards, Ivan Kitanov
Although your method may have worked, I ended up going a different route and set the checkbox programmatically. The requirements changed, which allowed me to do that. Thank you for taking the time with the original request.
Have you got the chance to try out my suggestion?
Please let me know if you need more time or if you have any questions or concerns.
Thank you Ivan, I will try it out!
The value of the CheckEditor is bound to the value of the cell, so I don't think that changing the value of the checkbox without changing the underlying value of the row object is possible.
However, a possible workaround would be to use an unbound checkbox column to change the value of the checkbox column and hide the actual checkbox column, in order to not change the underlying value of the row object. The InitializeRow event of the grid can be used to assign the value of the unbound checkbox column.
Afterwards depending on your application logic, the values changed by the user could be accessed via this unbound column and could be used independently from the values from the hidden bound column.
I have prepared a small sample to demonstrate what I have explained above, please test it on your side and let me know if you have any questions.
CheckedBoxUnboundCol.zip