Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
475
Force a CheckEditor inside an UltraGrid cell to be checked without changing the value to True
posted

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

Parents
No Data
Reply
  • 1700
    Verified Answer
    Offline posted

    Hello Sam,

    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.

    Regards,
    Ivan Kitanov

    CheckedBoxUnboundCol.zip

Children