String Properties

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 and Domain Components in WinForms and ASP.NET applications only).
  • You can use the Delayed Loading feature to improve performance when handling unlimited size properties (for XPO and Domain Components 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 applications, string properties with RTF or HTML-formatted text values can be displayed in Rich Text Property Editor .
  • In ASP.NET applications, string properties with HTML-formatted text values can be displayed in HTML Property 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 18.2\Components\eXpressApp Framework\FeatureCenter by default. The ASP.NET version of this demo is available online at http://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.

HTMLPropertyEditor

Important

The HTML Property Editor Windows Forms Module is required to provide compatibility with legacy WinForms XAF applications. If you create a new application, use the Office Module instead. With this module, you can edit HTML-formatted text in WinForms applications. It also supports RTF and DOCX formats. Refer to the Use Rich Text Documents in Business Objects topic for more information.

Control: HTMLEditor - a descendant of the System.Windows.Forms.UserControl.

Repository Item: RepositoryItemHtmlStringEdit - a descendant of the XtraEditors Library's RepositoryItemTextEdit item.

Description:

Intended for string properties and should be used in Detail Views only. Assign it to the PropertyEditorType property of the required Views | <DetailView> | Items | <PropertyEditor> node to use it. This Property Editor is supplied with the HTML Property Editor Module.

Using this Property Editor, you can visually format a string with HTML tags. There are two tabs. The Design tab has the instrument panel that allows you to format a string using HTML tags. The HTML tab displays plain HTML code.

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.

ASPxHtmlPropertyEditor

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

Edit mode control: ASPxHtmlEditor editor from the ASPxHtmlEditor library.

Description:

Intended for string properties and should be used in Detail Views only. Assign it to the PropertyEditorType property of the required Views | <DetailView> | Items | <PropertyEditor> node. This Property Editor is supplied with the HTML Property Editor Module.

Using this Property Editor, you can visually format a string with HTML tags. There are three tabs. The Design tab has the instrument panel that allows you to format a string with HTML tags. The HTML tab displays plain HTML code. The Preview tab displays rendered HTML.

Mobile Property Editors for String Properties

Each Mobile Property Editor has widgets that display a property in a Detail View's View and Edit mode (see DetailView.ViewEditMode). These widgets are listed below.

MobileStringPropertyEditor

View mode control: Label that displays text using the div HTML element.

Edit mode controls:

Description:

Used for string properties by default.

The Input control is used when the corresponding Views | <DetailView> | Items | <PropertyEditor> node's IModelCommonMemberViewItem.RowCount property value is set to 0 (the property's default value) or 1.

The TextArea control is used when the corresponding Views | <DetailView> | Items | <PropertyEditor> node's IModelCommonMemberViewItem.RowCount property value is more than 1.

See Also