Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

AfterUpdate event

The AfterUpdate even is not firing in a circumstance that I have.
This is with the Ribbon Bar.

In this case, I change a cell which includes some code for AfterUpdate, and then go straight to click on the Save command in the ribbon. The AfterUpdate is not triggered.
If I lose focus to an OI control, then it is triggered, just not when it goes to the ribbon command.

What is the best practice to resolve this situation.

Colin

Comments

  • By design, the buttons on the ribbon bar do not remove focus from the edit table, which is why the event never fires. So, in your Save button code, you have to manually force the edittable to update using the UpdateCellEdit method. You can even make this code generic to any control that has focus. This might not be the best news, but I think it would be worse if toolbar buttons stole focus.
  • Colin,

    As you have surmised, this is because the SRP Ribbon control does not force the EditTable to lose focus. When this happens I assume the EditTable still has a cursor in the cell?

    This is expected and desired behavior. This would be similar to having a homemade button bar using SRP Buttons with a toolbar style. If you need to resolve the AfterUpdate event then you need to trigger this using code within a SRP Ribbon control event.
  • Kevin

    Thanks, the UpdateCellEdit works perfectly.
    Just seems to be one of those things that can catch you out if unaware.
    Hopefully this post will be a reminder to others.

    Colin
  • I also note that the help says UpdateCellEdit should call the AfterUpdate event.
    I am not seeing this, with a debug in the OLE for this event, but it is not being triggered.
    I will continue to check in case I have made an error, but in the meantime I have used OnChar, as I am trying to set an indicator when something is changed, to prompt to save when changing records, and was using AfterUpdate to do this previously.
  • I just tested this and confirmed that it does fire. How are you qualifying your AfterUpdate and the ribbon control events?
Sign In or Register to comment.