Back to Devexpress

Grid Menus

wpf-15631-controls-and-libraries-property-grid-visual-elements-grid-menus.md

latest3.6 KB
Original Source

Grid Menus

  • Dec 01, 2022

Property Menu

The Property Menu allows users to invoke property-specific commands. This menu can be customized. For example, you can remove existing menu items and add new items.

The PropertyGridControl invokes the Property Menu in the following cases:

  1. A user clicks the property’s Menu Button.
  2. A user right-clicks the property (the PropertyGridControl.ShowMenu property should be set to OnRightClick or Always).
  3. You call the ShowPropertyMenu(String) method.

New Item Menu

The collection‘s New Item Menu allows users to add items to the collection. The New Item Initializer specifies item types displayed in this menu.

The PropertyGridControl invokes the New Item Menu in the following cases:

  1. A user clicks the collection’s Add Item button.
  2. You call the ShowNewItemMenu(String) method.

API

The table below lists the main properties that affect element behavior and appearance.

CharacteristicsMembers
Property Buttons VisibilityPropertyGridControl.ShowMenuButtonInRows, PropertyDefinition.ShowMenuButton, PropertyGridControl.ShowMenu
Collection Buttons VisibilityCollectionDefinition.AllowAddItems, CollectionDefinition.AllowRemoveItems, CollectionDefinition.AllowRemoveItemsWithoutNewItemInitializer, CollectionDefinition.HideCollectionButton, PropertyGridControl.CollectionButtonsVisibility
ContentPropertyGridControl.MenuOpening, PropertyGridControl.MenuCustomizations, PropertyDefinition.MenuCustomizations, PropertyDefinition.Command
Show and HideShowPropertyMenu(String), ShowNewItemMenu(String), IsMenuVisible, HideMenu()