We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to increase the performance by using Batch Update in SfDataGrid?

What is batch update?

Batch update is used to suspend the data operations like Sorting, Grouping, Filtering and Summary calculation, while modifying data (add, remove and property change). You can also use Batch updates to do bulk operations in SfDataGrid like sorting multiple column in single refresh, with optimized performance.

Data operations in SfDataGrid are suspended by calling SfDataGrid.View.BeginInit() method. After completing the bulk operations in SfDataGrid, you can refresh the View by calling SfDataGrid.View.EndInit(). Then data operations are resumed.

C:\Users\Giftline\Desktop\img.jpgNote: Use batch update only when you are doing bulk updates with Grid, or data operations like Sorting and Grouping in SfDataGrid. When you use batch update for single item refresh, then the performance will decreases.

Examples:

Sorting two columns by using Batch Update

When sorting the multiple columns in a single refresh in SfDataGrid, the performance decreases. So, you can use the Batch Update to increase the performance of the SfDataGrid. Before performing the SortColumnDescriptions for two columns, you can call the SfDataGrid.View.BeginInit(), and after performing SortColumnDescriptions for two columns, you can call SfDataGrid.View.EndInit() for refreshing the SfDataGrid.

The following code example explains how to use the SfDataGrid.View.BeginInit() and SfDataGrid.View.EndInit() methods.

C#

 

Real-time updates using Batch Update

When you do Real-time updates in SfDataGrid with huge amount of data, the performance decreases. So, you can use the Batch Update to increase the performance of the SfDataGrid. Before performing the Real-time update operation, you can call SfDataGrid.View.BeginInit() and after performing the Real-time update operation, you can call SfDataGrid.View.EndInit() for refreshing the SfDataGrid.

The following code example explains how to use the SfDataGrid.View.BeginInit() and SfDataGrid.View.EndInit() methods.

C#

 

Sample Links:

WPF

WRT

SilverLight

UWP

Article ID: Published Date: Last Revised Date: Platform: Control:
6065 01/22/2016 01/22/2016 UWP SfDataGrid
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.