Hi -
On right click of the xamRibbon control we get the "Show Quick Access Toolbar Above the Ribbon".
How can this be removed? If not removed, how can this be disabled?
Thanks in advance for your help. Regards,
-Gregg
Hello Gregg,
Thank you for your post. I have been reading through it and I have created a sample application for you that demonstrates how you can remove the menu item that you have referred to. To do that you can create a style with an EventSetter for the Opened event of the RibbonContextMenu and in the event handler you can get the item that you have mentioned and remove it from the Items collection of the RibbonContextMenu.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thanks for your assistance! That resolved the issue.
I am very glad that y reply helped solving your issue. Please let me know if you need any further assistance on the matter.
Thanks for the solution. In my case, I have disabled the QAT and collapsed it as well. In short, I don't the users to be able to interact with it at all. As a result, I have extended the solution to remove all references to the Quick Access Toolbar in the XamRibbon content menu. Now, the only menu item that shows is the Minimize Ribbon menu item.
public void RibbonContextMenuOpened(object sender, RoutedEventArgs e) { var menu = item as RibbonContextMenu; if (menu == null) return; // Loop to remove all menu items that reference the QAT while (true) { var removeIndex = -1; foreach (var item in menu.Items) { var menuItem = item as ToolMenuItem; if (menuItem == null) { continue; } if (menuItem.Header.ToString().Contains("Quick Access Toolbar")) { removeIndex = menu.Items.IndexOf(item); break; } } if (removeIndex == -1) { break; } menu.Items.RemoveAt(removeIndex); menu.Items.RemoveAt(removeIndex); // removes trailing separator } }
This suggestion does not work.
You don't need all the code behind at all.
Just do
<igRibbon:XamRibbon.Resources>
<Style TargetType="{x:Type ribbon:RibbonContextMenu}"> <Setter Property="Visibility" Value="Collapsed" /> </Style>
</igRibbon:XamRibbon.Resources>