I'm getting an error of "The query specified in the URI is not valid. Duplicate property named 'FieldName' is not supported in '$orderby'.", when opening a column filter menu for a column in the grid. The grid is configured for the OData adaptor, and the controller it's talking to is an OData controller. It has no problems retrieving data, paging through it, and sorting it.
However, when I open the column menu and expand the filter sub-menu, it displays the "busy" spinning circle and never returns. This only happens for columns which are part of the grid's current sort order. For other columns which are not part of the grid's sort order, it behaves properly, and the filtering behaves.
I watched the activity using Fiddler, for a column that wasn't in the grid's sort order, and found that it does two actions:
- It adds the column to the sort order and resubmits the query to the controller, retaining all the paging and sorting options. For example, if I open the filter menu for a field named "Field4", the query looks like this:
/odata/TableRecords?$count=true&$orderby=Field1,Field2,Field3,Field4&$skip=0&$top=12
- It then submits a shorter query to the controller, requesting all the data, sorted only by the column I've asked for the filter to appear on. This query has no paging or count options on it. This is the second query, based on the above example:
/odata/TableRecords?$count=true&$orderby=Field4
When the error occurs, it only performs the first action, and doesn't go on to do the second action because it encounters the "duplicate property" error first. For example, if I open the filter menu for Field3, which the grid is already sorted by, the query looks like this:
/odata/TableRecords?$count=true&$orderby=Field1,Field2,Field3,Field3&$skip=0&$top=12
The OData parser kicks out an HTTP 400 error because of the field appearing twice in the orderby clause sent to OData.
I realize OData is what is kicking up the error, but it's only doing so because the grid's functionality is sending an entirely unnecessary query first, before attempting to make the correct query (the second one). Can you suggest a workaround?
I'm working with v18.3.0.42 of your Blazor controls, and cannot currently upgrade into the v18.4.x version.