Skip to main content
Tab

ASPxAutoCompleteBoxBase.TextFormatString Property

Specifies a pattern used to display the selected item’s text in multi-column mode.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue("")]
public virtual string TextFormatString { get; set; }

Property Value

Type Default Description
String String.Empty

A format pattern.

Remarks

In multi-column mode, the control’s edit box displays the selected row’s values one by one, separated by a semicolon.

ASPxComboBox-TextFormatString-Default

The TextFormatString property allows you to change the selected item’s output text by a pattern that can contain literals and indexed placeholders such as “{0}”, “{1}”, and so on.

ASPxComboBox-TextFormatString-Default

<dx:ASPxComboBox ID="ASPxComboBox1" runat="server" DataSourceID="CustomersDataSource" ValueField="CustomerID"
    TextFormatString="{0} is from {1}">
    <Columns>
        <dx:ListBoxColumn FieldName="ContactName" />
        <dx:ListBoxColumn FieldName="Country" />
    </Columns>
</dx:ASPxComboBox>

You can also use a standard or custom format string to customize the displayed text.
The following table contains the standard 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 or 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.

ASPxComboBox-TextFormatString-Default

<dx:ASPxComboBox ID="ASPxComboBox1" runat="server" DataSourceID="SqlDataSource1" ValueField="ProductName" 
    TextFormatString="{0} costs {1:C}">
    <Columns>
        <dx:ListBoxColumn FieldName="ProductName" />
        <dx:ListBoxColumn FieldName="UnitPrice" />
    </Columns>
</dx:ASPxComboBox>

The following properties depend on the TextFormatString property:

See Also