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?
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,
The primary reason that we were hooking this event was because the xamGrid was not exiting edit mode and pushing the data to the underlying ItemsSource before the toolbar click event occurred.
And, as a matter of pure logic, if there is only a single event (i.e. no pre-click and post-click distinction) it makes more sense for the menu's ItemClicked event to be fired prior to the child's event. For example, if we want to limit dropdown menu options based on the context of, for example, the currently selected grid row. If the child item's event fires first, we have no ability to perform the necessary work in time.
Hello Karl,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
If this is what you were looking for please verify the answer so it helps other users as well.
Sincerely,Petar MonovDeveloper Support EngineerInfragistics Bulgariawww.infragistics.com/support