DXMenuItem.AllowHtmlText Property
Gets or sets whether HTML tags are used to format the menu item’s caption.
Namespace: DevExpress.Utils.Menu
Assembly: DevExpress.Utils.v25.2.dll
NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core
Declaration
Property Value
| Type | Default | Description |
|---|---|---|
| DefaultBoolean | Default | A DefaultBoolean value that specifies whether to parse HTML tags. |
Available values:
| Name | Description | Return Value |
|---|---|---|
| True | The value is true. |
|
| False | The value is false. |
|
| Default | The value is specified by a global option or a higher-level object. |
|
Remarks
Refer to the following help topic for information on HTML formatting: HTML-inspired Text Formatting.
The following code snippet adds a custom menu item to a column menu in a GridControl and uses HTML tags to format the menu item’s caption:
void GridView1_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e) {
if (e.MenuType == GridMenuType.Column) {
DXMenuItem item = new DXMenuItem("<color=red>Delete</color> (<b>not recommended</b>)");
item.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
e.Menu.Items.Add(item);
}
}
See Also