Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

String Properties

  • 5 minutes to read

A string property is displayed differently depending on the attributes applied to a string property and the corresponding settings specified in the Application Model.

  • String properties with a fixed length (for example, 100 or 15 characters) are displayed in a text editor.
  • Large string properties are displayed in a memo editor. These properties are not displayed in List Views by default.
  • String properties with a StringCompressionConverter Value Converter assigned are stored in the database in a compressed form (for XPO in WinForms and ASP.NET applications only).
  • You can use the Delayed Loading feature to improve performance when handling unlimited size properties (for XPO only).
  • If predefined values are specified in the Application Model (see IModelCommonMemberViewItem.PredefinedValues), string properties are displayed in a combo box editor (for WinForms and ASP.NET applications only).
  • In WinForms and ASP.NET applications, string properties with HTML-formatted text values can be displayed in Rich Text Editor.

Note

Refer to the Property Editors | String Properties section in the Feature Center demo installed with XAF to see String Property Editors in action. The Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 20.2\Components.NET Core Desktop Libraries\eXpressApp Framework\FeatureCenter by default. The ASP.NET Web Forms version of this demo is available online at https://demos.devexpress.com/XAF/FeatureCenter/.

Examples

WinForms Property Editors for String Properties

Each WinForms Property Editor has a control that displays a corresponding property in a Detail View, and a repository item that displays a property in a List Editor that supports in-place editing. Both the control and repository item are shown below.

StringPropertyEditor

Controls:

  • StringEdit - a descendant of the XtraEditors Library’s TextEdit editor;
  • PredefinedValuesStringEdit - a descendant of the XtraEditors Library’s ComboBoxEdit editor;
  • LargeStringEdit - a descendant of the XtraEditors Library’s MemoEdit editor.

Repository Items:

Description:

Used for string properties by default.

The StringEdit control and the RepositoryItemStringEdit item are used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s RowCount property is set to 0 (the property’s default value) or 1.

The PredefinedValuesStringEdit control and RepositoryItemPredefinedValuesStringEdit items are used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s RowCount property is set to 0 or 1, and the PredefinedValues property is specified. Use Alt + Down Arrow to expand the control’s drop-down window.

The LargeStringEdit control and RepositoryItemMemoExEdit repository items are used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s RowCount property is greater than 1. Note that this property affects only the minimum height of the LargeStringEdit control. The actual height is determined by the available space.

The StringPropertyEditor has the EditMaskType property. It is set to the value of the Views | <DetailView> | Items | <PropertyEditor> node’s EditMaskType property by default. In the Model Editor, you can set this property to the Simple or RegEx value. Set it to the Simple value if you need to set the Property Editor’s EditMask property or the PropertyEditor node’s EditMask property to a mask with a simplified syntax. Set it to the RegEx value if you need to set the EditMask property to a mask using a full-function regular expression. Note that the EditMaskType and EditMask properties are only considered by the RepositoryItemStringEdit and RepositoryItemPredefinedValuesStringEdit items. Refer to the Masks Types section of the Mask Editors Overview topic for details on masks.

Note

The StringEdit control and the RepositoryItemStringEdit item can be used to display a non-string property. For this purpose, assign the DevExpress.ExpressApp.Win.Editors.StringPropertyEditor Property Editor for the required BOModel | <Class> | OwnMembers | <Member> node’s PropertyEditorType property. In this instance, the property’s textual representation is displayed in the StringEdit control.

RichTextPropertyEditor

Control: RichEditorContainer - a wrapper for the XtraEditors Library’s RichEditControl.

Repository Item: XtraEditors Library’s RepositoryItemRichTextEdit item.

Description:

Intended for string properties and can be used in List and Detail Views. This Property Editor is supplied with the Office Module. This Property Editor allows you to edit rich text documents stored in the RTF or HTML format and create Mail Merge templates. Refer to the Use Rich Text Documents in Business Objects topic for more information about the RichTextPropertyEditor.

ASP.NET Property Editors for String Properties

Each ASP.NET Property Editor has controls that display a property in a Detail View‘s View and Edit mode (see DetailView.ViewEditMode). These controls are listed below.

ASPxStringPropertyEditor

View mode control: System.Web.UI.WebControls.Label.

Edit mode controls:

Description:

Used for string properties by default.

The ASPxTextBox control is used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s IModelCommonMemberViewItem.RowCount property is set to 0 (the property’s default value) or 1.

The ASPxMemo control is used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s IModelCommonMemberViewItem.RowCount property is greater than 1.

The ASPxComboBox control is used when the corresponding BOModel | <Class> | OwnMembers | <Member> node’s PredefinedValues property is specified. Use the Alt + Down Arrow to expand the control’s drop-down window.

ASPxRichTextPropertyEditor

View and Edit mode control: ASPxRichEdit editor from the ASPxEditors Library.

Description:

Intended for string properties and can be used in List and Detail Views. This Property Editor is supplied with the Office Module. This Property Editor allows you to edit rich text documents stored in the RTF or HTML format and create Mail Merge templates. Refer to the Use Rich Text Documents in Business Objects topic for more information about the ASPxRichTextPropertyEditor.

See Also