Skip to main content
Tab

ASPxGridViewTableDataCellEventArgs.Cell Property

Gets the processed data cell.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public TableCell Cell { get; }

Property Value

Type Description
TableCell

A System.Web.UI.WebControls.TableCell object that represents the processed data cell.

Example

This example handles the ASPxGridView.HtmlDataCellPrepared event to highlight the Budget column’s cells whose values are less than 100,000.

<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" KeyFieldName="ID"
    OnHtmlDataCellPrepared="ASPxGridView1_HtmlDataCellPrepared">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="DepartmentName" Caption="Department" />
        <dx:GridViewDataSpinEditColumn FieldName="Budget">
            <PropertiesSpinEdit DisplayFormatString="c0" />
        </dx:GridViewDataSpinEditColumn>
        <dx:GridViewDataTextColumn FieldName="Location" />
        <dx:GridViewDataTextColumn FieldName="Phone1" Caption="Phone" />
    </Columns>
</dx:ASPxGridView>
protected void ASPxGridView1_HtmlDataCellPrepared(object sender,
    DevExpress.Web.ASPxGridViewTableDataCellEventArgs e) {
    if(e.DataColumn.FieldName != "Budget")
        return;
    if(Convert.ToInt32(e.CellValue) < 100000)
        e.Cell.BackColor = System.Drawing.Color.LightCyan;
}

The image below shows the result:

HtmlDataCellPrepared

See Also