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. Image for the cookie policy date

View.BeginInit not working when using SfDataPager.

Hello,


I am using SfDataPager for performance improvements in DataGrid. I need to add about 1000 items in 100ms and this causes some freezing. The freezing issue with pagination has been resolved. But when I call MoveToLastPage after every addition, it still freezes. I wanted to use View.BeginInit but it doesn't seem to work if I use pagination.


3 Replies 1 reply marked as answer

DM Dhanasekar Mohanraj Syncfusion Team April 18, 2023 01:46 PM UTC

Hi Özgür,

We are a little unclear about your scenario, we are unable to reproduce the reported issue with the provided detail on our end. Here we have attached the tested sample. Please have a look at this. If you are still facing the reported issue, please share the below things,

  1. Provide the entire code snippets that related to the SfDataGrid both XAML and the code behind.

  2. Can you please share your exact requirement?

  3. Provide a replication procedure with a video illustration of the reported issue

  4. Modify the attached sample based on your scenario

It will be helpful for us to check on it and provide you with a solution as soon as possible.

Regards,

Dhanasekar M.


Attachment: SfDataGrid_Demo_de1a4efb.zip


ÖZ Özgür April 19, 2023 05:45 AM UTC

I've read in the docs to use sfDataGrid.View.BeginInit() for performance in bulk inserts and sfDataGrid.View.EndInit() after adding data. Unfortunately it doesn't work when used with DataPager. I've included an example below. Thanks for your help.


Attachment: SfDataGrid_Demo_cfea9c70.rar


DM Dhanasekar Mohanraj Syncfusion Team April 20, 2023 01:44 PM UTC

Özgür,


We have investigated the problem you reported and reviewed the details you provided. The paging feature is a performance-enhancing way to display large amounts of data in the UI. Normally, the UI updates for each and every change that occurs in the view. By using SfDataGrid.View.BeginInit and SfDataGrid.View.EndInit methods, you can restrict the UI updates and improve the performance. However, in the case of paging, you do not need to call these methods to improve performance.


We have modified the sample according to your scenario of adding 1000 records and calling MoveLastPage without using the aforementioned methods, but we did not encounter any UI freezing issues. We have attached the modified sample for your reference. Please review it and see if it helps resolve your issue. If you are still experiencing problems, please modify the attached sample to match your scenario, and provide us with a video illustration of the reported issue. This will enable us to investigate the issue further and provide you with a solution as soon as possible.


Attachment: SfDataGrid_Demo_c84018b2.zip

Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon