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
818
xamMenu ItemClicked event fired too late
posted

The xamMenu ItemClicked event is fired after the clicked menu item has already processed the event. Our issue is that we need to take the xamGrid out of edit mode before the child menu items process their commands, but with this sequence of events, we have to modify every menu handler.

Are there any alternatives?

Parents
No Data
Reply
  • 6475
    posted

    Hi,

    Could you provide some more details about your scenario ? Why do you need to force exit edit mode on the xamGrid upon MenuItem click ? The xamGrid should automatically exit edit mode when it looses focus (e.g., when you click a MenuItem).

    The only problem I can think of is if editing validation fails. In this case, the grid will not exit edit mode and will display validation error.If that's the case, you have two options:

    1. Disable EditingValidation on your columns (set column's AllowEditingValidation property to false)

    or

    2. Add event handler to grid's CellEditingValidationFailed event and force exit edit mode, canceling the invalid values entered:

    private void igGrid_CellEditingValidationFailed(object sender, CellValidationErrorEventArgs e)

    {

        e.Handled = true;

        igGrid.ExitEditMode(true);

    }

     

    Using either of these approaches should work without the need to call ExitEditMode in the Click event handler of each MenuItem.

     

    Hope that helps,

Children