Column filters do not work with OData

Hello

in the first case I used the url for OData with $filter and $include in line 26. This results in an incorrect OData request when I used the column filters in the grid. The expression $filter is then twice in the url.


In the second case, I tried to convert the url for OData into a query in lines 26 and 27. Unfortunately, I will not receive any data.


Please give me hints on how to formulate the query.


Attachment: Files_ff98493e.zip

1 Reply

RN Rahul Narayanasamy Syncfusion Team November 23, 2021 03:29 AM UTC

Hi Frank, 

Greetings from Syncfusion. 

We have validated your query with the provided details and we suspect that you want to pass filter query for fetching the corresponding Detail Grid data and expand query for expanding the complex properties. We suggest you to achieve your requirement by applying initial filtering using Query property. Find the below code snippets and sample for your reference. 

 
<SfGrid ID="Grid" @ref="Grid" AllowFiltering="true" Query="Qry" TValue="CustomerViewModel" Toolbar="@ToolbarItems" Height="100%" AllowPaging="true" AllowSorting="true"> 
    <GridPageSettings PageSize="2"></GridPageSettings> 
    <SfDataManager @ref="dm" Url="http://localhost:64956/odata/books" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager> 
    <GridEvents OnActionFailure="ActionFailureHandler" OnActionBegin="OnBegin" TValue="CustomerViewModel"></GridEvents> 
    . . . 
</SfGrid> 
 
 
@code{    
    SfDataManager dm { get; set; } 
    public Query Qry = new Query().Where("Gender", "equal", "Female").Where("StoreGroupsId", "equal", 2).Expand(new List<string> { "Group", "Div" }); 
    . . . 
} 


Reference

If you want to apply any initial filter then use the below link for more reference. 


Please let us know if you have any concerns. 

Regards, 
Rahul 


Loader.
Up arrow icon