Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Collapse]Business Model Design
    Business Model Design Basics
    Built-in Business Classes for Most Popular Scenarios
   [Expand]Business Model Design with Entity Framework
   [Expand]Business Model Design with XPO
    Non-Persistent Objects
    PropertyChanged Event in Business Classes
   [Collapse]Data Types Supported by built-in Editors
     Key Properties
    [Collapse]String Properties
      String Properties in XPO
      String Properties in Entity Framework
      String Properties in Domain Components
    [Expand]Numeric Properties
    [Expand]Date and Time Properties
    [Expand]Boolean Properties
    [Expand]BLOB Image Properties
    [Expand]Collection Properties
    [Expand]Reference (Foreign Key, Complex Type) Properties
    [Expand]File Attachment Properties
    [Expand]Type Properties
    [Expand]Enumeration Properties
    [Expand]Criteria Properties
    [Expand]Color Properties
     Geolocation Properties
     Miscellaneous Property Types
    Mapping Complex Types to the Database
   [Expand]Types Info Subsystem
    Connect an XAF Application to a Database Provider
    Data Annotations in Data Model
    Create and Update the Application's Database
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
  Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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).
  • String properties with HTML-formatted text values can be displayed in HTML Property Editors Editor (WinForms or ASP.NET).

WinForms

ASP.NET

Mobile

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 17.2\Components\eXpressApp Framework\FeatureCenter by default. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/.

Expanded Examples

Expanded 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).

    The PredefinedValuesStringEdit control and RepositoryItemPredefinedValuesStringEdit items are used when the corresponding BOModel | <Class> | OwnMembers | <Member> node's RowCount property is set to 0, 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 not set to 0.

    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

    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.

Expanded 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 control:

    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).

    The ASPxMemo control is used when the corresponding BOModel | <Class> | OwnMembers | <Member> node's IModelCommonMemberViewItem.RowCount property is not set to 0.

    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.

Expanded 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.

Expanded See Also

How would you rate this topic?​​​​​​​