Grid custom data querying

By default the GridModelBuilder will query the data (order and get page), but you can to that yourself and pass the ordered and paged data. You might need to do that if you're using stored procedures, service calls, or any other data storage tech that doesn't support linq.
You might also want to load the data using async/await methods and only after that pass it to the GridModelBuilder, and for this scenario the GridModelBuilder has methods to apply the OrderBy and Page on your query before you call your Async Load method, see examples below.

Manually ordering and paging data 

Drag a column header and drop it here to group by that column
Id
Person
Food
679RajeshOat meal
683BenFrench toast
687JustinHot Beverage
691CourtneyCheesecake
695BernadettePizza
699TimmyShepherd's pie
703ClaudiaHot Beverage
707MateoApple
711GabrielleFrench toast
715JamieCheesecake

Here we are showing how we could query the data manually before passing it to the GridModelBuilder. One could also use something like Dynamic Linq or generate a sql script etc.

Execute async query before building model 

Drag a column header and drop it here to group by that column
Id
Person
Food
3675MaryShepherd's pie
3671JeremyPizza
3667JohnCheesecake
3663MichaelHot Beverage
3659GabrielleFrench toast
3655LucyBig Salad
3651CheyenneBig Salad
3647JonahShepherd's pie
3643FernandoSoup
3639AudreyShepherd's pie

In this grid we are fetching the data before calling GridModelBuilder.Build, this way you could use an async call to fetch data, await for the call and after pass the items and count to the GridModelBuilder.
See also: Grid with List Count Column



Comments