Filter row via visible column

Hi, I have problem with approach to filter row.

I have dynamic data with lots of column around 200
All works fine all filters via columns etc.

after all data load to datagrid

then I have 10 columns (for test). ID, Role, Column1, Column2, Column3,... , Column8

when I filter "aaa" via "Role" all columns are visible.


Now I want click "button" which will show me only this columns which have "x" (if I click again go back to all columns)

ID, Role, Column1,Column3,Column5

how achieve that ?

Hi @lavazza,

You can hide columns via their Visible property as in this demo: Blazor DataGrid Component - Column Picker | Free UI Components by Radzen

 <RadzenDataGridColumn Visible="@EmployeeIDVisible" TItem="Employee" ...  />

I have tried hide columns with this button (and it is working), but how to managed do this with content like X in row

I am afraid I don't understand this. Hiding a column will hide all of its cells too as shown in the demo.

Pictures will say all :wink:


so looking solution for "button" to hide not used column

You will have to find the columns that contain null yourself and then hide them. RadzenDataGrid does not have any API for that.

ok, so where in grid is store information what "user" put to "advance" filter in my case in "role" column ("aaa")?

You can use the Filter event to get the currently applied filter.

<RadzenDataGrid TItem="Order" Filter=@OnFilter ... >

@code {
    void OnFilter(DataGridColumnFilterEventArgs<Order> args)
        var column = args.Column;
        var value = args.FilterValue;

Thank you, it is working as you wrote :slight_smile: