Connecting SQL Data to Blazor DataGrid with Custom Adaptor Using EF

  Рет қаралды 582

Syncfusion, Inc

Syncfusion, Inc

Күн бұрын

Пікірлер: 4
@sardarabdalla
@sardarabdalla Ай бұрын
what about pagination and sorting and filtering with server side with ef core ? not in-memory
@SyncfusionInc
@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
@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
@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
Connecting SQL Data to Blazor DataGrid with URL Adaptor Using EF
14:03
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 97 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Connecting SQL Server Data to Blazor DataGrid with Custom Adaptor
13:18
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 122 М.
Database Indexing Explained (with PostgreSQL)
18:19
Hussein Nasser
Рет қаралды 326 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 225 М.
Why Does Scrum Make Programmers HATE Coding?
16:14
Thriving Technologist
Рет қаралды 528 М.
Blazor CRUD Operation with SQL Server: Step-by-Step Guide (using .NET 8.0) | BLAZOR CRUD OPERATIONS
26:50
𝐂𝐨𝐝𝐞𝐖𝐢𝐭𝐡𝐆𝐨𝐩𝐢
Рет қаралды 10 М.
Why Your Backend Shouldn't Serve Files
19:40
Boot dev
Рет қаралды 78 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН