Hi,
i work on an asp.net core hosted blazor wasm (.Net 7.0.16).
I had a page with a RadzenDataGrid generated from Blazor Studio and bind to a SqlServer table. I use paging, sorting and filtering; all working as expected.
Now i create a stored procedure (SP), that combine some columns and replace foreign keys with the values of the lookup tables, since the grid is for 'Readonly'. I use a parameter as 'filter' for the SP, that in the former version was used as a 'odata filter'
former version:
protected IEnumerable<MyAdmino.Server.Models.MyAdminoDB.TPersonenliste> tPersonenlistes;
protected RadzenDataGrid<MyAdmino.Server.Models.MyAdminoDB.TPersonenliste> grid0;
Sorry, i copy and paste from VS2022; but all 'format info' (color, ...) is lost on paste:
old version (do all right):
Variables:
protected IEnumerable<MyAdmino.Server.Models.MyAdminoDB.TPersonenliste> tPersonenlistes;
protected RadzenDataGrid<MyAdmino.Server.Models.MyAdminoDB.TPersonenliste> grid0;
protected int count_Kontakt;
New Version:
Variables:
public IEnumerable Person_Liste;
protected RadzenDataGrid<MyAdmino.Server.Models.MyAdminoDB.PLadePersonListe> grid0;
protected int count_Kontakt;
I think the problem is that the result set of the SP is on the client and i miss the way to page, filter and sort on the 'client-collection'. So your datagrid need 'filter: sFilter, orderby: $"PersRefnr desc", top: args.Top, skip: args.Skip' parameter. But how can i set this on the result of a SP?
var Pers = await MyAdminoDBService.PLadePersonListesFunc(iMand_ID);
-- here i load the data from the SP
count_Kontakt = Pers.Count;
-- here i set the number of rows i though; but as i must see Pers.Count = 0!!!
Person_Liste_Temp = Pers.Value.AsQueryable();
-- here i load my data realy!!
count_Kontakt = Person_Liste_Temp.Count();
-- and now count_Kontakt got the number of rows in the collection (attention: you must use the method count() not the field 'Count'!!)
Now all works as in the old version!
Thanks for your help and sorry that i not found the solution in the beginning!
To summarize (if someone had similar problems):
In the LoadData-event of the Datagrid catch the 'LoadDataArgs args' and handle 'args.Filter', 'args.OrderBy' and paging via 'Skip(args.Skip.Value).Take(args.Top.Value).ToList()'.