Back to Devexpress

AutoCompleteBoxPropertiesBase.TextFormatString Property

aspnet-devexpress-dot-web-dot-autocompleteboxpropertiesbase-8bce8d24.md

latest5.6 KB
Original Source

AutoCompleteBoxPropertiesBase.TextFormatString Property

Gets or sets the pattern used to format the selected item’s text displayed within the editor’s edit box.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue("")]
public string TextFormatString { get; set; }
vb
<DefaultValue("")>
Public Property TextFormatString As String

Property Value

TypeDefaultDescription
StringString.Empty

A string value that is the format pattern.

|

Remarks

The TextFormatString property is in effect if the editor is used in multi-column mode. In this mode, the editor’s selected item is represented within the editor’s edit box using a text value whose format is based upon the TextFormatString property’s setting.

By default, the TextFormatString property is set to an empty string. In this case, the selected item is represented within the editor’s text box by the values of all visible columns. The order of column values in the text box directly corresponds to the visible order of columns within the editor’s dropdown window and correlates with the order in which columns are listed within the editor’s ComboBoxProperties.Columns collection. Column values are separated with a default separator represented by a semicolon and white space symbols.

You can use the TextFormatString property to provide a custom format for the selected item’s value displayed within the editor’s edit box. Set the property’s value by using indexed placeholders (such as “{0}”, “{1}”, etc.), which can be combined with fixed literals. Placeholder indexes correspond to positions of visible columns (whose ListBoxColumn. Visible property is not set to false) within the ComboBoxProperties.Columns collection.

You can change the format in which a value is displayed using standard or custom format strings. The table below lists some of typical format specifiers.

Format specifierNameDescription
“C”CurrencyA currency value
“D”DecimalInteger digits with an optional negative sign
“E”ExponentialExponential notation
“F”Fixed-pointIntegral and decimal digits with an optional negative sign
“G”GeneralThe most compact of either fixed-point or exponential notation
“N”NumberIntegral and decimal digits, group separators, and a decimal separator with an optional negative sign
“P”PercentNumber multiplied by 100 and displayed with a percent symbol

If the incremental filtering feature is enabled (the AutoCompleteBoxPropertiesBase.IncrementalFilteringMode property is not set to IncrementalFilteringMode.None), the value typed by the end-user into the edit box is searched within the editor’s list, based upon the TextFormatString property’s defined format.

If the editor’s AutoCompleteBoxPropertiesBase.ValueField property is not defined, the text value formatted using the TextFormatString property is used as the editor’s value.

Note

The TextFormatString property synchronizes its value with the editor’s ASPxAutoCompleteBoxBase.TextFormatString property.

See Also

TextFormatString

Columns

List Editors in Multi-Column Mode

Code central example E3591: How to use the TextFormatString property for multi-column ASPxComboBox

Combo Box

Formatting Types in the .NET Framework

AutoCompleteBoxPropertiesBase Class

AutoCompleteBoxPropertiesBase Members

DevExpress.Web Namespace