Skip to main content

RepositoryItem.AllowHtmlDraw Property

Gets or sets whether HTML tags can be used to format an editor’s text or text of the editor’s items.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v22.1.dll

Declaration

[DefaultValue(DefaultBoolean.Default)]
[DXCategory("Behavior")]
public virtual DefaultBoolean AllowHtmlDraw { get; set; }

Property Value

Type Default Description
DefaultBoolean Default

A DefaultBoolean value that specifies whether HTML tags can be used to format an editor’s text or text of the editor’s items.

Available values:

Name Description
True

true. DefaultBoolean.True has a constant value of 0, while the standard true value corresponds to a value of 1. In Visual Basic, do not use implicit conversion of Boolean values to DefaultBoolean, and vice versa, as the conversion may produce incorrect results.

False

false. DefaultBoolean.False has a constant value of 1, while the standard false value corresponds to a value of 0. In Visual Basic, do not use implicit conversion of Boolean values to DefaultBoolean, and vice versa, as the conversion may produce incorrect results.

Default

The default behavior determined by the control’s logic.

Remarks

If the AllowHtmlDraw property is set to True, you can use HTML tags to format an editor’s text or the text of the editor’s items. For detailed information, see HTML Text Formatting.

Note

The AllowHtmlDraw property is not supported by all editors. For ButtonEdit descendants, the property is supported when text editing is disabled (the RepositoryItemButtonEdit.TextEditStyle property is set to TextEditStyles.DisableTextEditor).

For a list of editors supported this property, see HTML Text Formatting.

Example

The following example shows how to format the BaseCheckEdit.Text using HTML tags. HTML formatting is enabled via the RepositoryItem.AllowHtmlDraw property. The image below shows the result:

checkEdit_HTML_formatting

checkEdit1.Text = "<size=14>Size = 14 <br/> <b>Bold</b> <i>Italic</i> 
<u>Underline</u> <br/><size=11>Size = 11<br/> <color=255, 0, 0>Sample Text";

checkEdit1.Properties.AllowHtmlDraw = DefaultBoolean.True;
checkEdit1.Properties.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
checkEdit1.Properties.Appearance.Options.UseTextOptions = true;
See Also