BootstrapComboBox.TextFormatString Property
Gets or sets the pattern used to format the selected item’s text displayed in the editor’s edit box.
Namespace: DevExpress.Web.Bootstrap
Assembly: DevExpress.Web.Bootstrap.v24.1.dll
NuGet Package: DevExpress.Web.Bootstrap
Declaration
Property Value
Type | Default | Description |
---|---|---|
String | String.Empty | A string value that represents 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 BootstrapComboBox.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 BootstrapComboBox.Fields collection.
You can change the format in which a value is displayed using standard or custom format strings. The table below lists some 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 incremental filtering is enabled (the ASPxAutoCompleteBoxBase.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 ASPxAutoCompleteBoxBase.ValueField property is not defined, the text value formatted using the TextFormatString property is used as the editor’s value.
Note
This property is a wrapper of the AutoCompleteBoxPropertiesBase.TextFormatString property. Refer to its description for more information.