Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4110

Radzen Blazor Datagrid filtering in WASM

$
0
0

I'm in the process of implementing filtering with radzen blazor datagrid.We currently have a WASM project so implementing filtering we would have to use query parameters.

For example we might be getting a product from the database but we are getting it in a different format than it is stored:

class CategoryAsStoredInDatabase{    string name;}class ProductAsStoredInDatabase{    string name;    int CategoryId;}class GetProductToShowInDatagrid{    string Name;    string CategoryName;}

`

but when filtering with the radzen datagrid it generates a string with the PropertyNames.When we apply this string and send it as a query parameter we get the error that there is no property name called CategoryName in the database and rightly so.

If we would search for Products that have these letters (c o d)in their category name the string generated would be something like this:

Filter=(new%20%5B%5D%7BC,o,d%7D).Contains(CategoryName)

Now the solution is to map out the correct property names and inject the correct property names but then if I would replace CategoryName with CategoryId I would get wrong results as only integers are stored in that column.

The other solutions are:

  • Generate a sql view for the big tables and then apply the filter string directly to that.

  • Instead of applying pageing to the datagrid, just getting all the records at once but that would impact the performance big time in the future.

  • Create a filter system in for the API for example ...Productsfilter=CategoryName[equals]=cod[contains]=abc;SomeOtherPropertyName[Operator]=filtervalue

    and then changing the filtering system in the datagrid accordingly and mapping out in the endpoint handlers for each available property within the DTO. Sounds like it will take a long time to implement.

I'm not sure what is the best course of action since Radzen has much to offer in their datagrid and their advanced filter mode looks really good.

Is there some pre-existing filter best-practices I can look at which might apply in this situation?


Viewing all articles
Browse latest Browse all 4110

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>