Is there a way to filter a RadzenDataGrid by query string or something of the same effect?
I have one grid that each row has a RadzenLink to another page in the application, I want that link to pass an Id and have the destination page filter by that Id
Check how our CRUD pages are passing the Id of the record from view page with the DataGrid to the edit page - parameter is declared in @page directive in the razor file and there is a property with the same name in the C# file.
Hi Chad,
i'm not the top blazor or radzen expert, but for me this works perfect:
I create a service with a class inside with a lot of variables and dictonaries. There i store different ID's for the grid or forms as 'load-filter' and 'lookup'-tables for the comboboxes
On the Click event, i store the necessary values in the service-variables
On the load-event of the new page or dialog, i read this values and bind it to the filter of the query
My question to enchev:
If i have some kind of master-detail structure (real depndencies), is it better to open the details in a new page or a dialog?
I inject my lookup-service in each page it use it. On the other hand i must declare each parameter on each page. With a view of 'ressource use', what is the better way?
I do not see how the @page comes into play as far as a parameter.
I do see how the edit row works though, it uses the DialogService to open the edit page. I'm already doing something similar without args because I just need the Id
<RadzenDataGridColumn TItem="RadzenBlazorServerApp.Models.sql_database.Load" Property="Truck.NameNum" Title="Truck">
<Template Context="load">
@{
if (load.Truck != null)
{
<RadzenButton Variant="Variant.Text" Click=@(args => EditTheTruck(load.Truck.Id)) Text="@load.Truck.NameNum" ButtonStyle="ButtonStyle.Primary" />
}
}
</Template>
</RadzenDataGridColumn>
and in the c#
protected async Task EditTheTruck(int Id)
{
await DialogService.OpenAsync<EditTruck>("Edit Truck", new Dictionary<string, object> { { "Id", Id } });
}
So my question now is how do I just go to a different page vs it being a diaglog box?