Skip to main content
All docs
V25.1
  • ContextItemCollectionOptions.AllowHtmlText Property

    Gets or sets whether context items support HTML tags.

    Namespace: DevExpress.Utils

    Assembly: DevExpress.Utils.v25.1.dll

    NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

    Declaration

    [DefaultValue(false)]
    [XtraSerializableProperty]
    public bool AllowHtmlText { get; set; }

    Property Value

    Type Default Description
    Boolean false

    true if context items support HTML tags; otherwise, false.

    Property Paths

    You can access this nested property as listed below:

    Object Type Path to AllowHtmlText
    CameraControl
    .ContextButtonOptions .AllowHtmlText
    CalendarControlBase
    .ContextButtonOptions .AllowHtmlText
    ImageSlider
    .ContextButtonOptions .AllowHtmlText
    RepositoryItemPictureEdit
    .ContextButtonOptions .AllowHtmlText
    SvgImageBox
    .ContextButtonOptions .AllowHtmlText
    TileControl
    .ContextButtonOptions .AllowHtmlText
    TileView
    .ContextButtonOptions .AllowHtmlText

    Remarks

    You can use HTML tags to format ContextItem text. The code below demonstrates how to change a ContextButton‘s caption color.

    using DevExpress.Utils;
    // ...
    pictureEdit1.Properties.ContextButtonOptions.AllowHtmlText = true;
    ((ContextButton)pictureEdit1.Properties.ContextButtons[0]).Caption = "<color=red>Select</color>";
    

    The image below demonstrates the result.

    AllowHtmlText

    Alternatively, you can set AllowHtmlText to true in the Properties window.

    PropertiesAllowHtmlText

    Then click the ContextButtons ellipsis button to open the Collection Editor.

    ContextButtonsCollection

    Specify the ContextButton‘s caption text and formatting.

    EditorAllowHtmlText

    See Also