Skip to main content
Tab

ASPxGridViewExportRenderingEventArgs.Column Property

Gets a data column that corresponds to the processed grid element.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public GridViewColumn Column { get; }

Property Value

Type Description
GridViewColumn

A GridViewColumn object that specifies the data column. null (Nothing in Visual Basic) if the processed element doesn’t belong to a column (e.g. preview, footer).

Example

This example shows how to draw company names in an exported document based on the number of products. Company names are painted in Green if the product count is greater than 1,000. Otherwise, company names are painted in Red.

The image below shows the result:

RenderBrick

using DevExpress.Web.Export;
using DevExpress.Web.ASPxGridView;

protected void grid_ExportRenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e) {
    GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;
    if(e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.FieldName == "CompanyName") {
        e.BrickStyle.ForeColor = (decimal)e.GetValue("ProductAmount") > 1000 ? Color.Green : Color.Red;
        e.BrickStyle.BackColor = Color.LightYellow;
    }
}

protected void btn_Click(object sender, EventArgs e) {
    grid.ExportPdfToResponse();
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Column property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also