Save $100 with our Black Friday deals!

Get $100 OFF with promo code BLACKFRIDAY2024 at checkout until November 30.

See Pricing

Still using Radzen Studio?
Achieve more with Radzen Blazor Studio

Radzen Blazor Studio is our new flagship product and vision of how rapid Blazor application development should be done.

Go to Radzen Blazor Studio

Default filter value for DataGrid column (Angular)

This guide demonstrates how to set default filter value for DataGrid column.

Source Code

Step by step

1. Create new application with .NET server-side project and add new MSSQL data-source connected to Northwind database.

2. Create new Orders page and bind DataGrid to Orders table.

3. Add new Page property defaultOrderID, define $filter parameter for Northwind.getOrders method invoke on Page load event, define $filter parameter ${event.filter ? event.filter + ' and ':''}OrderID eq ${defaultOrderID} for Northwind.getOrders method invoke on DataGrid LoadData and bind DataGrid OrderID column to defaultOrderID.

4. Set defaultOrderID to this.grid0.columns.first.filterValue in DataGrid LoadData event and define $filter parameter ${event.filter ? event.filter + ' and ':''}${this.defaultOrderID ? 'OrderID eq ' + this.defaultOrderID : ''} for Northwind.getOrders method invoke on DataGrid LoadData.

5. Run the application