ListBoxItemTextCellPreparedEventArgs.TextCell Property
Gets the currently processed cell of the editor.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Description |
---|---|
TableCell | A TableCell object that is the currently processed cell. |
Remarks
Use the TextCell property to customize the cell appearance.
Example
The following example illustrates how to customize the appearance of combo box items.
string GetItemTooltip(ListEditItem item) {
return string.Format("Country: {0}\r\nCity: {1} \r\nAddress: {2}",
item.GetFieldValue("Country"), item.GetFieldValue("City"), item.GetFieldValue("Address"));
}
protected void customersComboBox_ItemTextCellPrepared(object sender, ListBoxItemTextCellPreparedEventArgs 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";
}
protected void customersComboBox_ItemRowPrepared(object sender, ListBoxItemRowPreparedEventArgs e) {
e.Row.ToolTip = GetItemTooltip(e.Item);
}
See Also