ASPxClientComboBox.AddItemTextCellCssClass(itemIndex, textCellIndex, className) Method

Sets the CSS class for a combo box item's text cell specified by its index.


    itemIndex: number,
    textCellIndex: number,
    className: string
): void


Name Type Description
itemIndex number

An integer value specifying the zero-based index of the item.

textCellIndex number

An integer value specifying the zero-based index of the item's text cell.

className string

A string value specifying the CSS class name.


Use the AddItemTextCellCssClass property to specify the CSS class for the item's text cell of the editor on the client side.


This example illustrates how to customize the appearance of columns in a combo box.

<head runat="server">
   <style type="text/css">
        .class1 {
            color: #006100;
            background-color: #C6EFCE;
            font-weight: bold;
        .class2 {
            color: brown;
            background-color: azure;
            font-weight: bold;
    <form id="form1" runat="server">
        <dx:ASPxComboBox ID="ASPxComboBox1" runat="server" ClientInstanceName="clientComboBox" DataSourceID="SqlDataSource1">
                <dx:ListBoxColumn FieldName="ContactName" />
                <dx:ListBoxColumn FieldName="CompanyName" />
                <dx:ListBoxColumn FieldName="Phone" />
            <ClientSideEvents Init="function(s, e) {
                for (i = 0 ; i < clientComboBox.GetItemCount(); i++){
                    clientComboBox.AddItemTextCellCssClass(i,1, 'class1');
                    clientComboBox.AddItemTextCellCssClass(i,2, 'class2');
            }" />        
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=|DataDirectory|\nwind.mdb;Persist Security Info=True" ProviderName="System.Data.OleDb" 
SelectCommand="SELECT [CompanyName], [ContactName], [ContactTitle], [Address], [City], [Region], [Country], [Phone] FROM [Customers]"></asp:SqlDataSource>        
See Also