Skip to main content
A newer version of this page is available. .
Tab

ASPxCardViewExportRenderingEventArgs.BrickStyle Property

Gets the style settings used to paint report bricks.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

public BrickStyle BrickStyle { get; }

Property Value

Type Description
BrickStyle

A BrickStyle object that contains style settings.

Remarks

Use the BrickStyle property to specify the appearance of report bricks. You can specify the foreground, background and border colors for bricks, the font, border side settings and text formatting information.

Example

This example conditionally applies a style to 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, the company names are painted in ‘red’.

Note

A complete sample project is available in the following repository: https://github.com/DevExpress-Examples/aspxcardview-how-to-draw-company-names-in-an-exported-document-t332460

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ASPxCardViewExporter1_RenderBrick(object sender, DevExpress.Web.ASPxCardViewExportRenderingEventArgs e)
    {
        CardViewColumn dataColumn = e.Column as CardViewColumn;

        if (dataColumn != null && dataColumn.FieldName == "ProductName")
        {
            e.BrickStyle.ForeColor = (decimal)e.GetValue("UnitPrice") > 10 ? Color.Green : Color.Red;
            e.BrickStyle.BackColor = Color.LightYellow;

        }
    }
    protected void ASPxButton1_Click(object sender, EventArgs e)
    {
        ASPxCardViewExporter1.WritePdfToResponse();
    }
}
See Also