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

ListBoxSettings.ItemTextCellPrepared Property

Occurs on the server side before a text cell has been rendered.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v19.2.dll


public EventHandler<ListBoxItemTextCellPreparedEventArgs> ItemTextCellPrepared { get; set; }
Public Property ItemTextCellPrepared As EventHandler(Of ListBoxItemTextCellPreparedEventArgs)

Property Value

Type Description

A EventHandler<TEventArgs><ListBoxItemTextCellPreparedEventArgs,> delegate method allowing you to implement custom processing.


Write a ItemTextCellPrepared event handler to customize the cell appearance (CssClass, Tooltip, control styles) before it is rendered. To customize the cell's appearance, use the ListBoxItemTextCellPreparedEventArgs.TextCell, ListBoxItemTextCellPreparedEventArgs.Column and ListBoxItemTextCellPreparedEventArgs.Item properties.

The editor's content is customized using the ASPxListBox.ItemTemplate property.


The following example illustrates how to customize the appearance of combo box items.


    settings => {
        settings.Name = "customersListBox";
        settings.CallbackRouteValues = new { Controller = "Editors", Action = "ListBoxWithItemCustomizationPartial" };
        // ...

        settings.ItemTextCellPrepared += (s, e) => {
            if(e.Column.FieldName == "ContactName") {
                string contactTitle = e.Item.GetFieldValue("ContactTitle").ToString();
                if(contactTitle == "Owner") {
                    e.TextCell.CssClass += " owner";
                    e.TextCell.ToolTip = "Owner";
            if(e.Column.FieldName == "Phone")
                e.TextCell.CssClass += " phone";
        settings.ItemRowPrepared += (s, e) => {
            ListEditItem item = e.Item;
            e.Row.ToolTip = string.Format("Country: {0}\r\nCity: {1} \r\nAddress: {2}",
                item.GetFieldValue("Country"), item.GetFieldValue("City"), item.GetFieldValue("Address"));
        // ...

See Also