BootstrapComboBoxProperties.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.Bootstrap
Assembly: DevExpress.Web.Bootstrap.v24.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
String | String.Empty | A string value that is the format pattern. |
Remarks
The TextFormatString property is in effect if the editor is used in multi-field 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 data fields. The order of data field values in the text box directly corresponds to positions of data fields within the BootstrapComboBoxProperties.Fields collection. Data field 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 data fields within the BootstrapComboBoxProperties.Fields collection.
You can change the format in which a value is displayed using [standard]https://learn.microsoft.com/en-us/dotnet/standard/base-types/formatting-types#standard-format-strings) or custom format strings. The table below lists some of typical format specifiers.
Format specifier | Name | Description |
---|---|---|
“C” | Currency | A currency value |
“D” | Decimal | Integer digits with an optional negative sign |
“E” | Exponential | Exponential notation |
“F” | Fixed-point | Integral and decimal digits with an optional negative sign |
“G” | General | The most compact of either fixed-point or exponential notation |
“N” | Number | Integral and decimal digits, group separators, and a decimal separator with an optional negative sign |
“P” | Percent | Number 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.