Skip to main content
All docs
V25.2
  • 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

    [DefaultValue(DefaultBoolean.Default)]
    public DefaultBoolean AllowHtmlText { get; set; }

    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.

    0

    False

    The value is false.

    1

    Default

    The value is specified by a global option or a higher-level object.

    2

    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