Home Forums WinForms controls Xceed Grid for WinForms Update after editing of a cell doesn’t seem to happen

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #12811 |

    I have a GridControl. The DataSource is a DataTable. The DataMember is “” or null.

    When I edit one of the cells (using e.g. the GridCheckBox), and I leave the cell, the old value pops into the cell again, instead of the new value.

    Does anyone know what might cause this?

    Imported from legacy forums. Posted by Tommy (had 4264 views)

    User (Old forums)
    Member
    Post count: 23064

    maybe you have code in your cell leavingedit event that crashes,or your checkbox might not be set correctly and it may cause a crash. if that happens, it wont crash your application, it will fire the validationerror event of the corresponding cell.

    by default, validationerror will do a canceledit on the cell(that brings back the old value)

    to see if thats your problem, add a validationerror event on your cell and put a dummy messagebox in it, if you see it, it means something somewhere as crashed and caused the canceledit. you can see where and why it crashes by doing

    msgbox(e.exception.tostring)

    Imported from legacy forums. Posted by Louis (had 396 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for trying to help me.

    First, I’ve tried that, but the <b>ValidationError</b>-event is never fired.

    Secondly, I’ve tried to catch the <b>LeaveEdit</b>-event of the cell, to see if the editor passes the right value back to the cell, but that seems to work right.

    Thirdly, I’ve tried to catch the <b>ValueChanging</b>-event and the <b>ValueChanged</b>-event.
    When I leave the cell-editor, the <b>ValueChanging</b>-event is fired once, with <b>e.NewValue</b> containing the correct value.
    After that, the <b>ValueChanged</b>-event is fired twice. In the first <b>ValueChanged</b>, the value in the cell is the new, correct value. In the second (unexpected) <b>ValueChanged</b>, the value has changed to the old value, without <b>ValueChanging</b> being fired again.

    Any ideas?

    Imported from legacy forums. Posted by Tommy (had 278 views)

    User (Old forums)
    Member
    Post count: 23064

    i dont really know then…

    its true that the dual valuechanged looks suspicious.

    what i would do next is put a msgbox system.environment.stacktrace in valuechanged event to see where the 2 calls come from…other then that i dont know…

    ps : im at home now (no .net) so im not really sure if you get stacktrace from system.environment namespace, but i know its *somewhere* in the framework.

    Imported from legacy forums. Posted by Louis (had 265 views)

    User (Old forums)
    Member
    Post count: 23064

    I managed to locate the error: there was a <b>ValidationError</b>-event fired, not from a Cell, but from a DataRow. This event was fired because of an error in a <b>CurrentCellChanged</b>-eventhandler.

    Thanks for the help.

    Imported from legacy forums. Posted by Tommy (had 5034 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.