......
Hi Ping,
We are validating your query and will update you the details on or before 14th July 2022.
Regards,
YuvanShankar A
thanks
YuvanShankar A
Hi Ping,
We have validated your reported query and prepared the sample based on your requirement. Please refer the below code snippet.
|
@using Syncfusion.Blazor.QueryBuilder @using Syncfusion.Blazor.Data @using Syncfusion.Blazor.Grids
<div class="col-lg-12 control-section"> <SfQueryBuilder @ref="querybuilder" TValue="Order"> <QueryBuilderRule Condition="and" Rules="@importRules"></QueryBuilderRule> <QueryBuilderEvents TValue="Order" RuleChanged="UpdateRule" Created="created"></QueryBuilderEvents> <SfDataManager Url="https://services.odata.org/V4/Northwind/Northwind.svc/Orders" Adaptor="Syncfusion.Blazor.Adaptors.ODataV4Adaptor"></SfDataManager> </SfQueryBuilder> </div>
<div class="col-lg-12 control-section"> <div class="content-wrapper"> <div class="row"> <SfGrid TValue="Order" DataSource="@gridData" AllowPaging="true"> <GridEvents Created="created" TValue="Order"></GridEvents> <GridColumns> <GridColumn Field=@nameof(Order.OrderID) HeaderText="TaskID" TextAlign="TextAlign.Right" Width="120"></GridColumn> <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Name" Width="150"></GridColumn> <GridColumn Field=@nameof(Order.ShipCity) HeaderText="Category" TextAlign="TextAlign.Right" Width="120"></GridColumn> <GridColumn Field=@nameof(Order.ShipCountry) HeaderText="Serial No" Width="150"></GridColumn> <GridColumn Field=@nameof(Order.ShippedDate) Format="MM/dd/yyyy" HeaderText="Invoice No" Width="150"></GridColumn> </GridColumns> </SfGrid> </div> </div> </div>
@code { SfQueryBuilder<Order> querybuilder; private IEnumerable<Order> gridData { get; set; } private List<RuleModel> importRules = new List<RuleModel>(); private void created() { if(querybuilder.DataSource == null) { importRules = new List<RuleModel>() { new RuleModel { Field = "CustomerID", Label = "CustomerID", Operator = "equal", Type = "String", Value = "VINET" } }; } gridData = querybuilder.GetFilteredRecords().ToList().AsEnumerable<Order>(); } private void UpdateRule(RuleChangeEventArgs args) { if (querybuilder.GetValidRules().Rules.Count > 0) { gridData = querybuilder.GetFilteredRecords().ToList().AsEnumerable<Order>(); } else { gridData = querybuilder.DataSource; } StateHasChanged(); } public class Order { public int? OrderID { get; set; } public string CustomerID { get; set; } public string ShipCity { get; set; } public string ShipCountry { get; set; } public DateTime? ShippedDate { get; set; } } }
|
Could you please check the above sample and get back to us, if you need any further assistance on this.
Regards,
YuvanShankar A
How about performance if api return 1 Million records or more ?
It's work with grid paging, grid column search or any filter data feature of sfgrid right?
Is there an example that works perfectly together?
query builder + OData API + large data set(1 Milltion or more) + sfgrid(paging, page size, filter, search and others.)
thanks.
Hi Teeramed,
We are validating your query and will update you the details on or before 22nd September 2022.
Regards,
YuvanShankar A
Hi Teeramed,
We have prepared an sample as per your shared requirement using OData with grouping paging and filtering and query builder. Kindly check the attached sample for your reference.
Please let us know if you have any concerns.
Regards,
YuvanShankar A