what about pagination and sorting and filtering with server side with ef core ? not in-memory
@SyncfusionIncАй бұрын
Hi, Based on your query, we would like to clarify that you need to implement paging, sorting, and filtering when using a custom adaptor. We recommend using the PerformSkip and PerformTake methods for paging, the PerformFiltering method for filtering, and the PerformSorting method for sorting. We already have documentation on these topics. Kindly refer to the documentation below for your reference. blazor.syncfusion.com/documentation/datagrid/connecting-to-database/entityframework#handling-paging-operation-1 blazor.syncfusion.com/documentation/datagrid/connecting-to-database/entityframework#handling-filtering-operation-1 blazor.syncfusion.com/documentation/datagrid/connecting-to-database/entityframework#handling-sorting-operation-1
@sardarabdallaАй бұрын
@@SyncfusionInc all of them are In-memory pagination ,filtering..etc . you get all order from database like this IEnumerable DataSource = await OrderService.GetOrdersAsync(); then you do pagination and filtering... which is wrong!! imagine i have million records! i have read all syncfuion blazor documents i couldn’t find any example of real server side pagination and filtering..etc. for entity framework. all of your example is in memory.
@SyncfusionIncАй бұрын
@@sardarabdalla The custom adaptor interacts with the DataManagerRequest, which encapsulates details about the operations requested by the grid. For example, it contains properties like Where (filter conditions), Sorted (sorting information ), Skip (records to skip for paging), and Take (records to fetch for paging). These values can be accessed and used in the custom adaptor to handle operations manually. Kindly refer to the below code snippet for your reference. Thanks for your understanding. So, we would like to clarify that we have handled grid-side data operations using the PerformSorting, PerformFiltering, PerformSkip, and PerformTake methods. These methods are designed to handle operations on the grid-side effectively. However, if these methods are not necessary for your use case and , you can manage the required actions externally on your own and return the resultant data to bind it to the Grid. The SfDataManager in DataGrid provides support for a custom adaptor enabling manual control over data operations. A custom adaptor is particularly useful when you need fine-grained control over how data is managed, sorted, filtered, paginated, or processed. public class CustomAdaptor : DataAdaptor { public override object Read(DataManagerRequest dm, string key = null) { // Log or inspect the DataManagerRequest values Console.WriteLine($"Filters: {dm.Where}"); Console.WriteLine($"Sort Order: {dm.Sorted}"); Console.WriteLine($"Page Size: {dm.Take}"); // Perform your own custom data retrieval logic here // Apply sorting, filtering, paging, etc., if needed if (dm.Sorted != null) { // Perform sorting logic } if (dm.Where != null) { // Perform filtering logic } int count = DataSource.Cast().Count(); //Here Implement pagination logic here based on request.Skip and request.Take if (dm.Skip != 0) { //Paging } if (dm.Take != 0) { } // Return data with total record count for paging return new DataResult() { Result = data, Count = data.Count() }; } } Reference blazor.syncfusion.com/documentation/datagrid/custom-binding#data-binding Additionally, we suggest performing server-side data operations. We have already documented this topic. Refer to the documentation below for more information blazor.syncfusion.com/documentation/datagrid/data-binding#entity-framework