Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ContextItemCollectionOptions.AllowHtmlText Property

Gets or sets whether context items support HTML tags.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v24.2.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