DataGrid Sort & Filter

I have a table with 8 integer columns that relate to lookup tables. When using a DataGrid and I click on a column header it is sorted based on the integer and not the related string from the lookup table. Same with filter. It filters on the integer and not the lookup value or the template value. How can I change the behavior to sort and filter on the lookup string values?

Hi @larrywhite,

You are right! In the current official version this is not supported however we’ve exposed sortProperty and filterProperty for DataGrid columns and these properties will be set to lookup text fields during automatic code generation. We will do our best to release new version before the end of this week, I’ll let you know when available.

Best Regards,
Vladimir

Hi @larrywhite,

The new release (1.16.3) is out! Please regenerate your app (or delete all pages in your current app and regenerate them) using our latest build and let us know if you have any questions and/or problems.

Best Regards,
Vladimir

I downloaded and installed the new version and deleted my application. Recreated the application and the sort works correctly but the screen freezes when I type in a filter. I can move away from the screen and try again typing a filter string but the screen always freezes.

Hi @larrywhite,

Do you have many rows in this grid? If this is the case you can turn on the grid paging. Any additional info about your scenario will be appreciated (which table, column, etc.). We have your data-base schema (without data) and we can try to replicate the issue locally.

Best Regards,
Vladimir

Hi @larrywhite,

We’ve managed to reproduce server-side exception during filtering of lookup column (visible in Radzen Output page and browser console) and in this case the the grid loading indicator will continue to spin forever. Is this the problem you see at your end?

Best Regards,
Vladimir

Hi,

Just a quick update. We hit a limitation in Microsoft OData/EntityFramework Core integration and we are working to find solution for the problem. In the meantime please excuse us for the temporary inconvenience.

Best Regards,
Vladimir

Hi @larrywhite,

The problem is fixed and the new version (1.16.4) is out. Let us know how it goes!

Best Regards,
Vladimir

I tried the filter like this:

I can see in the network requests that the api is called every time i enter something in the filter field, but the $filter is not added to the uri.

Is it also possible to debounce x millisecond (in the input observable)? If the user is typing, so the call is delayed until the use stops and the debounce time is hit?

Hi @bartnetjs,

How the grid is bound in your case? Automatic filtering, sorting and paging will work in case of OData (V3 and 4 are supported), Microsoft SQL Server or MySQL.

Best Regards,
Vladimir

hi @enchev

It is MSGraph, they support oData V4: see

I noticed that the generated code doesn't include any filtering:

for example this is the generated load function:

load() {
this.msGraph.listUsers()
.subscribe((result: any) => {
this.ListUsersResult = result.value;
}, (result: any) => {

});

}

Hi @bartnetjs,

According to your other thread your data-source is Swagger not OData and that is why you do not have OData parameters (for filtering, sorting and paging) for the service calls. We will research how to use MS Graph with Radzen and we will provide more info in your other thread.

Best Regards,
Vladimir

1 Like