Hello all respected members.
I have a question on how to add AND condition to WHERE clause on below syncfusion datagrid code:
<SfGrid DataSource="@detailData" Query="@(new Query().Where("book_name","equal",_data.book_name))" AllowPaging="true">
What I want to achieve is that I can have more than 1 conditions from the code.
Thank you.
2
Answers
If you want to apply multiple conditions in a query, you can generate predicates using the WhereFilter and then pass the generated predicates to the Grid Query property for performing filtering operations in the Grid. Please refer to the code snippet and documentation below for your reference.
Reference:
https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.WhereFilter.html
https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.WhereFilter.html#Syncfusion_Blazor_Data_WhereFilter_And_Syncfusion_Blazor_Data_WhereFilter_
https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.WhereFilter.html#Syncfusion_Blazor_Data_WhereFilter_Or_Syncfusion_Blazor_Data_WhereFilter_
You can chain
Where
methods to apply multiple filters in a row which is equivalent to AND.Doc