How do you cancel navigation of the ribbon? I have a grid on with edits pending and I want to prevent navigation with the ribbon. Other than disabling the ribbon, I have not been able to prevent the icons on the ribbon from changing with either a shortcut or a mouse input. I can prevent the tool change from running any code but then the ribbon selection is out of synch with the app. I have checked that Infragistics.Win.UltraWinToolbars.ToolbarEventIds.BeforeNavigation is enabled but it never fires. At this point, I am trying all of the before events but I can still change the tab within the ribbon. Here is the code of interest.
Thanks,
Private Sub UltraToolbarsManager1_BeforeNavigation(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeNavigationEventArgs) Handles UltraToolbarsManager1.BeforeNavigation
e.Cancel =
True
End Sub
Private Sub UltraToolbarsManager1_BeforeToolActivate(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.CancelableToolEventArgs) Handles UltraToolbarsManager1.BeforeToolActivate
Private Sub UltraToolbarsManager1_BeforeRibbonTabDropDown(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeRibbonTabDropDownEventArgs) Handles UltraToolbarsManager1.BeforeRibbonTabDropDown
Private Sub UltraToolbarsManager1_BeforeShortcutKeyProcessed(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeShortcutKeyProcessedEventArgs) Handles UltraToolbarsManager1.BeforeShortcutKeyProcessed
Private Sub UltraToolbarsManager1_BeforeRibbonTabSelected(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeRibbonTabSelectedEventArgs) Handles UltraToolbarsManager1.BeforeRibbonTabSelected
Private Sub UltraToolbarsManager1_BeforeTaskPaneToolSelected(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeTaskPaneToolSelectedEventArgs) Handles UltraToolbarsManager1.BeforeTaskPaneToolSelected
Private Sub UltraToolbarsManager1_BeforeRibbonGroupDropDown(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeRibbonGroupDropDownEventArgs) Handles UltraToolbarsManager1.BeforeRibbonGroupDropDown
Private Sub UltraToolbarsManager1_BeforeToolEnterEditMode(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeToolEnterEditModeEventArgs) Handles UltraToolbarsManager1.BeforeToolEnterEditMode
Private Sub UltraToolbarsManager1_BeforeToolDropdown(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeToolDropdownEventArgs) Handles UltraToolbarsManager1.BeforeToolDropdown
Private Sub UltraToolbarsManager1_BeforeToolbarListDropdown(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeToolbarListDropdownEventArgs) Handles UltraToolbarsManager1.BeforeToolbarListDropdown
Private Sub UltraToolbarsManager1_BeforeApplicationMenuDropDown(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles UltraToolbarsManager1.BeforeApplicationMenuDropDown
Private Sub UltraToolbarsManager1_BeforeToolbarReset(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.CancelableToolbarEventArgs) Handles UltraToolbarsManager1.BeforeToolbarReset
Private Sub UltraToolbarsManager1_BeforeMiniToolbarShown(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeMiniToolbarShownEventArgs) Handles UltraToolbarsManager1.BeforeMiniToolbarShown
Private Sub UltraToolbarsManager1_BeforeDisplayMoreItemsDialog(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.CancelableToolEventArgs) Handles UltraToolbarsManager1.BeforeDisplayMoreItemsDialog
Private Sub UltraToolbarsManager1_BeforeDisplayCustomizeDialog(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeDisplayCustomizeDialogEventArgs) Handles UltraToolbarsManager1.BeforeDisplayCustomizeDialog
Private Sub UltraToolbarsManager1_BeforeComponentReset(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles UltraToolbarsManager1.BeforeComponentReset
Private Sub UltraToolbarsManager1_ToolKeyDown(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolKeyEventArgs) Handles UltraToolbarsManager1.ToolKeyDown
e.SuppressKeyPress =
Tried starting a new app with only the toolbarmanager with two ribbons Used the wizard to create the full control. The BeforeNavigation still does not fire. How do you cancel user inputs to the ribbon without just disabling the control? Here is the only code:
namespace
WindowsFormsApplication2
{
Form
Form1()
InitializeComponent();
.BeforeNavigation);
+ isEnb.ToString());
}
e)
);
;
I have the same issue with BeforeRibbonTabSelected. I cant cancel it.
Any answers?
According to the Office 2007 UI Guidelines, if the user clicks on a ribbon tab, it must be selected. So canceling this event could potentially violate the guidelines. But if you'd like to cancel it anyway, you can do so by setting UltraToolbarsManager.Office2007UICompatibility to False.
Office2007UICompatability set to false. I am using latest release 12.2.20122.2006. How do I prevent ribbon Navigation? BeforeToolActivate fires when the mouse moves over the ribbon.
Hello matt_dmaxx,
Regarding your question about "BeforeNavigation" event. This event will fired when you are using your UltraToolbarManager in "Navigation Toolbar" mode. Looking at the provided screenshot your are not using this mode, that`s why the event didn`t fire. More details about this mode you could find in our online documentation: http://help.infragistics.com/Help/NetAdvantage/WinForms/2012.2/CLR4.0/html/WinToolbarsManager.html
Regarding your requirement to disable UltraToolbarManager during your grid is in edit mode, you could use one of these options below:
- to disable whole UltraToolbarManager
- to disable only the tool just when the mouse hover over the tool. You could handle BeforeToolActivate event and using the code:
private void ultraToolbarsManager1_BeforeToolActivate(object sender, CancelableToolEventArgs e)
e.Tool.SharedProps.Enabled =false;
if you are using shortcuts you should take a care also for the ToolClick event.
Please let me know if you have any further questions.
Regards
Maybe one possible approach to achieve desired behavior could be if you handle suitable event and using the SharedProps.Enabled property to disable your tools during your grid is in Edit mode.