The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientComboBox.SetItemHtml(index, html) Method

Defines the HTML content for the specified combo box item.


SetItemHtml(index: number, html: string): void


Name Type Description
index number

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

html string

A string value that is the HTML code defining the content of the combo box item.


Use the SetItemHtml method on the client side to dynamically provide a combo box item with the specified HTML content.


The following example illustrates how to specify the HTML content for combo box items using the ASPxClientComboBox.SetItemHtml method.


    function OnclientComboBox_Init(s, e) {
        for (i = 0; i < clientComboBox.GetItemCount() ; i++) {
            if (i % 2 == 0)
                clientComboBox.SetItemHtml(i, "<b>" + clientComboBox.GetItem(i).text + "</b>");
                clientComboBox.SetItemHtml(i, "<i>" + clientComboBox.GetItem(i).text + "</i>");

<form id="form1" runat="server">
    <dx:ASPxComboBox ID="ASPxComboBox1" ClientInstanceName="clientComboBox" runat="server">
            <dx:ListEditItem Text="Item 1" Value="0" />
            <dx:ListEditItem Text="Item 2" Value="1" />
            <dx:ListEditItem Text="Item 3" Value="2" />
            <dx:ListEditItem Text="Item 4" Value="3" />
        <ClientSideEvents Init="OnclientComboBox_Init" />
See Also