Home Forums WinForms controls Xceed Grid for WinForms Programmatically editing a cell

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

    Hi. I need to change the value of a cell programmatically, but doing so means the LeavingEdit event is not fired. How can I edit the cell programmatically in such a way that this event gets fired?

    Thanks

    kh

    Imported from legacy forums. Posted by kh (had 3485 views)

    User (Old forums)
    Member
    Post count: 23064

    Got it – Cell.EnterEdit() and Cell.LeaveEdit().

    Imported from legacy forums. Posted by kh (had 348 views)

    User (Old forums)
    Member
    Post count: 23064

    I had this same question and found the same answer, but it doesn’t seem to be working.

    Here’s my snippet:

    With moduleRow.Cells(“Publish”)
    .EnterEdit()
    .Value = e.NewValue
    .LeaveEdit(True)
    End With

    The EnterEdit produces no error and the value assignment works, but when I hit the LeaveEdit (to hopefully fire that event for the cell), I get an error that the cell was not being edited.

    Any ideas ?

    Thanks,
    Bob S.

    Imported from legacy forums. Posted by bob_shirley (had 292 views)

    User (Old forums)
    Member
    Post count: 23064

    <code>With moduleRow.Cells(“Publish”)
    .Value = e.NewValue
    .EnterEdit()
    .LeaveEdit(True)
    End With</code>(EnterEdit copies the value to the CellEditor, LeaveEdit copies the value from the CellEditor back to the cell)

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

    User (Old forums)
    Member
    Post count: 23064

    Thanks for your idea, Tommy – I just tried it, and while it did eliminate the exception I had been getting, I still am not seeing the event fire.

    I’ve since come up with a workaround that doesn’t require this event to fire anyway, but again, thanks for the input !

    Bob S.

    Imported from legacy forums. Posted by bob_shirley (had 4485 views)

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