Blazor Grid - Other examples

Use Blazor Bootstrap grid component to display tabular data from the data source. And it supports client-side and server-side filtering, paging, and sorting.

Cell formating#

To format the cell data, use ToString method and format strings. Refer: How to format numbers, dates, enums, and other types in .NET
TIP
Example: @context.Salary.ToString("N2").

Cell nowrap#

To prevent text from wrapping, add TextNoWrap="true" to the GridColumn.

Empty data#

If there are no records to display in the Grid, by default, it will display the No records to display message. You can change this message by adding the EmptyText parameter to the Grid.

Empty data template#

Set the GridEmptyDataTemplate to customize the message displayed when the grid has no records.

Custom column headers#

In the below example, we use <HeaderContent> and <ChildContent> tags to define custom column header and cell content. When defining header content, filters and sorting are removed from column.