Skip to main content

ASPxAutoCompleteBoxBase.ItemTemplate Property

Specifies a common template used for displaying the content of all items in the combo box and token box.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.2.dll

NuGet Package: DevExpress.Web


public virtual ITemplate ItemTemplate { get; set; }

Property Value

Type Default Description
ITemplate null

An object that contains the item template.


Use the ItemTemplate property to define a common content for all items in the combo box or token box controls. This template replaces the content of each item in the editor - in particular, the item’s text.

The style settings defined for the items using the specific properties (such as the ASPxAutoCompleteBoxBase.ItemStyle property) are still in effect for the items whose contents are specified by using the ItemTemplate property.

Once a template defined by the ItemTemplate property is created in a control, it is instantiated in a container object of the ListEditItemTemplateContainer type. This container object exposes a set of specific properties to which the template’s child controls can be bound.

Run Demo: Combo Box - Item Template

<dx:ASPxComboBox ID="ComboBox" ClientInstanceName="ClientComboBox" EnableCallbackMode="true" 
                 SelectedIndex="0" DropDownRows="4" CallbackPageSize="5" ForceDataBinding="true" 
                 DataSourceID="ContactsDataSource" TextField="Name" Width="285" runat="server">
                <td rowspan="2">
                    <div class="frame">
                        <img class="photo" alt="photo" src="<%# Page.ResolveUrl(Eval("PhotoUrl").ToString()) %>" />
                <td class="name"><%# Eval("Name") %></td>
                <td class="description">
                    <div class="contactInfo">
                        <%# Eval("Address") %><br />
                        <%# Eval("Phone") %>
                    <%# Eval("Email") %>
        <SelectedStyle CssClass="selectedItem" />
        <HoverStyle CssClass="hoveredItem" />

Combobox Item Template

See Also