Tab
A newer version of this page is available. Switch to the current version.

ComboBoxProperties.ValueType Property

Gets the data type of the editor's values.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue(typeof(string))]
public Type ValueType { get; set; }
<DefaultValue(GetType(String))>
Public Property ValueType As Type

Property Value

Type Default Description
Type

string

A Type object that represents the type of values.

Remarks

The ValueType property's value affects the data type used to specify the ListEditItem.Value property of the editor's items.

The ValueType property supports the following values.

  • System.Boolean
  • System.Int16
  • System.Int32
  • System.String
  • System.Char
  • System.Byte
  • System.Guid
NOTE

The ValueType property synchronizes its value with the editor's ASPxComboBox.ValueType property.

Examples

The following example demonstrates how to use the ASPxAutoCompleteBoxBase.TextFormatString property for a ASPxComboBox which contains several columns. The text of the selected ASPxComboBox item displayed within the input box is formatted by the ASPxAutoCompleteBoxBase.TextFormatString property. This property value is specified with respect to the selected ASPxRadioButtonList item. The complete sample project is available in the DevExpress Code Central database at E1331.

...
<script runat="server">
    protected void ASPxRadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) {
        if (ASPxRadioButtonList1.SelectedIndex == 0) { 
            ASPxComboBox1.TextFormatString = "{0} {1}, {2} Company";   
        }
        if (ASPxRadioButtonList1.SelectedIndex == 1) { 
            ASPxComboBox1.TextFormatString = "{1} {0}, {2} Company";
        }      
    }
 </script>
...
        <dxe:ASPxRadioButtonList ID="ASPxRadioButtonList1" runat="server" 
            onselectedindexchanged="ASPxRadioButtonList1_SelectedIndexChanged" 
            ClientInstanceName="rbl">
            <ClientSideEvents SelectedIndexChanged="function(s, e) {
                e.processOnServer=true;
            }" />
            <Items>
                <dxe:ListEditItem Text="FirstName LastName, Company" Value="Format1" />
                <dxe:ListEditItem Text="LastName FirstName, Company" Value="Format2" />
            </Items>
        </dxe:ASPxRadioButtonList>
        <br/>
        <dxe:ASPxComboBox ID="ASPxComboBox1" runat="server" 
            DataSourceID="AccessDataSource1" EnableIncrementalFiltering="True" 
            TextFormatString="{0} {1}, {2} Company" ValueType="System.String" Width="450px">
            <Columns>
                <dxe:ListBoxColumn Caption="First Name" FieldName="FirstName" 
                    Name="FirstName" />
                <dxe:ListBoxColumn Caption="Last Name" FieldName="LastName" Name="LastName" />
                <dxe:ListBoxColumn Caption="Company" FieldName="Company" Name="Company" />
            </Columns>
        </dxe:ASPxComboBox>
...
See Also