Blazor Grid — Appearance Customization Enhancements (v22.1)

ASP.NET Team Blog
23 August 2022

With v22.1, you can now customize the DevExpress Blazor Grid to better address your business requirements (our Blazor Grid allows you to modify the appearance of 30+ grid UI elements (rows, cells, edit form, filter row, group panel, footer, etc)).

You can also apply unique formatting based on specific rules. By incorporating rule-based formatting, you can help users identify trends, recognize exceptions, and compare relevant data points in a more efficient manner.

To activate this feature, handle the CustomizeElement event, and specify which UI elements to customize and which styles or CSS classes to apply. Thanks to the power of CSS, you can create any grid design with relative ease.

<DxGrid Data="Data" 
        CustomizeElement="OnCustomizeElement"> 
	... 
</DxGrid> 
@code { 
    void OnCustomizeElement(GridCustomizeElementEventArgs e) { 
        if(e.ElementType == GridElementType.DataRow) { 
            var unitsValue = Convert.ToInt16(e.Grid.GetRowValue(e.VisibleIndex, "UnitsInStock")); 
            if(unitsValue == 0) 
                e.CssClass = "strikethrough-item"; 
        } 
        if(e.Column.Name == "UnitsInStock") { 
                var unitsValue = Convert.ToInt16(e.Grid.GetRowValue(e.VisibleIndex, "UnitsInStock")); 
                if(unitsValue > 0 && unitsValue <= 10) 
                    e.Style = "background-color: #edc2c2"; 
            } 
        } 
    } 

Appearance Customization

You can explore grid element customization options in the following online demos:

If time permits, feel free to review the following GitHub examples as well:

Your Feedback Counts

Please take a moment to respond to the following survey question.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.