SfDataGrid inside SfPullToRefresh can not horizontal scroll when have a little rows data (1 -> 5 rows).

Hi Syncfusion, 

I have a problem when using SfPullToRefresh with Content is SfDataGrid. I can not scroll, very lag.

Here my out put:

[Choreographer] Skipped 96 frames! The application may be doing too much work on its main thread.

[nyname.griddem] Explicit concurrent copying GC freed 4560(367KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 4748KB/9497KB, paused 351us total 12.694ms

[nyname.griddem] Explicit concurrent copying GC freed 3865(176KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 4860KB/9720KB, paused 331us total 12.398ms

[nyname.griddem] Explicit concurrent copying GC freed 3477(151KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 4980KB/9961KB, paused 338us total 12.671ms

[nyname.griddem] Explicit concurrent copying GC freed 3108(126KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 5110KB/10220KB, paused 330us total 13.058ms

[nyname.griddem] Explicit concurrent copying GC freed 3897(186KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 5227KB/10MB, paused 336us total 13.566ms


Demo in my attachment.

Thanks


Attachment: GridDemo_a8b439e6.zip

18 Replies

NK Nguyen Khoa Lu August 27, 2021 10:01 AM UTC

In addition, I have a problem when using Navigation.PushAsync a page with content is a SfDataGrid and SfDataGrid is being end horizontal scroll state.

Steps test:

Step 1. After app loading, clicking button to show Page have Grid. After that, scroll horizontal to column end.

Step 2. Pressed Back button

Step 3. Clicking button to show Page again.

=> Grid error like this photo:


Demo in my attachment.

Thanks




NK Nguyen Khoa Lu August 27, 2021 10:02 AM UTC

Attachment here, Demo grid show error


Attachment: GridDemo_259ac557.zip


SV Suja Venkatesan Syncfusion Team August 27, 2021 12:02 PM UTC

Hi Ngyugen,  

Thank you for contacting Syncfusion support. 

We are able to reproduce the reported issue "Horizontal Scrolling getting lag when loading SfDataGrid as PullableContent of SfPullToRefresh". Currently, we are analyzing the issue with our source. We will update the details for this issue on or before 31st August 2021. We appreciate your patience until then. 

Regarding the "Row's are not appearing when navigating back to the previous page and comes to Datagrid page", We would like to let you know that you have created a Datagrid containing page instance at only one time, and by using that created instance you had navigated back to Datagrid page. So, in this case, the Row's are not properly layout on the page. So, we suggest you dispose of the Datagrid on OnDisappearing method of the page and create a new instance for DataGrid on OnAppearing method of the page like the below code snippets. 

Code snippets : 
 
public class GridPage : ContentPage 
{ 
  
  
SfDataGrid grid; 
SfPullToRefresh refresh; 
public GridPage() 
{ 
grid= new SfDataGrid 
{ 
AllowLoadMore = false, 
AutoGenerateColumns = false, 
AllowResizingColumn = true, 
ResizingMode = ResizingMode.OnTouchUp, 
ColumnSizer = ColumnSizer.SizeToHeader, 
ScrollingMode = ScrollingMode.Pixel, 
VerticalOverScrollMode = VerticalOverScrollMode.None, 
AllowDiagonalScrolling = false, 
EnableDataVirtualization = true, 
RowHeight = 40, 
HeaderRowHeight = 40, 
SelectionMode = Syncfusion.SfDataGrid.XForms.SelectionMode.SingleDeselect, 
DefaultColumnWidth = 150, 
}; 
  
refresh = new SfPullToRefresh(); 
//refresh.PullableContent = grid; 
refresh.Refreshing += OnRefresh; 
  
grid.BackgroundColor = Color.Yellow; 
grid.HorizontalOptions = grid.VerticalOptions = LayoutOptions.FillAndExpand; 
grid.ItemsSource = GetSource(); 
for (int i = 1; i < 11; i++) 
AddColumn($"P{i}", $"Property {i}"); 
Content = grid; 
} 
  
private async void OnRefresh(object sender, EventArgs e) 
{ 
refresh.IsRefreshing = true; 
await Task.Delay(100); 
refresh.IsRefreshing = false; 
  
} 
  
        protected async override void OnAppearing() 
        { 
            base.OnAppearing(); 
if (grid== null) 
{ 
grid = new SfDataGrid 
{ 
AllowLoadMore = false, 
AutoGenerateColumns = false, 
AllowResizingColumn = true, 
ResizingMode = ResizingMode.OnTouchUp, 
ColumnSizer = ColumnSizer.SizeToHeader, 
ScrollingMode = ScrollingMode.Pixel, 
VerticalOverScrollMode = VerticalOverScrollMode.None, 
AllowDiagonalScrolling = false, 
EnableDataVirtualization = true, 
RowHeight = 40, 
HeaderRowHeight = 40, 
SelectionMode = Syncfusion.SfDataGrid.XForms.SelectionMode.SingleDeselect, 
DefaultColumnWidth = 150, 
}; 
grid.BackgroundColor = Color.Yellow; 
grid.HorizontalOptions = grid.VerticalOptions = LayoutOptions.FillAndExpand; 
grid.ItemsSource = GetSource(); 
for (int i = 1; i < 11; i++) 
AddColumn($"P{i}", $"Property {i}"); 
this.Content = grid; 
this.ForceLayout(); 
} 
} 
  
        protected override void OnDisappearing() 
        { 
            base.OnDisappearing(); 
grid.ItemsSource = null; 
grid.Dispose(); 
grid = null; 
this.Content = null; 
        } 
  
        public ObservableCollection<Model> GetSource() 
{ 
var size = new Random().Next(1, 5); 
var result = new ObservableCollection<Model>(); 
for (int i = 0; i < size; i++) 
result.Add(new Model($"Value {i}", $"Value {i}", $"Value {i}", $"Value {i}", $"Value {i}", $"Value {i}", $"Value {i}", $"Value {i}", $"Value {i}", $"Value {i}")); 
return result; 
} 
  
public void AddColumn(string mapping, string header) 
{ 
grid.Columns.Add(new TextColumn(mapping, header)); 
} 
  
} 


Regards,
Karthik Raja
 



NK Nguyen Khoa Lu August 27, 2021 12:27 PM UTC

Hi,

Thanks for your reply.

Regarding the "Row's are not appearing when navigating back to the previous page and comes to Datagrid page",

Is there a good solution?

My Grid Page is designed to reuse much times, I can not set Grid to null. I want save last user state and I want show old Page without dispose grid object.

Any another solution for that?

Thanks



SV Suja Venkatesan Syncfusion Team August 30, 2021 12:48 PM UTC

Hi Nguyen, 

Thanks for the update. 

We are able to understand what you are trying to achieve and found a suitable workaround to overcome the issue. Please ForceLayout the scrollview after the page loaded. For more details, please refer to the below code snippets. 

Code snippets : 
 
public class GridPage : ContentPage
{
......
 protected async override void OnAppearing()
 
        { 
            base.OnAppearing(); 
 
await Task.Delay(100); 
this.grid.GetVisualContainer().AndroidScrollOwner.ForceLayout(); 
        }
...
 

Regards,
Karthik Raja
 
 



NK Nguyen Khoa Lu replied to Suja Venkatesan August 31, 2021 06:06 AM UTC

It work for me on Android. But, how about IOS? Thanks.

Now, Im waiting Syncfusion to fix Scroll lag.


Thanks.



KK Karthikraja Kalaimani Syncfusion Team September 1, 2021 05:42 PM UTC

Nguyen, 

Thanks for the update. 

Currently, we are validating the issue with our source. So, we will update further details on or before 3rd Sept 2021. We appreciate your patience until then. 

Regards,
Karthik Raja


KK Karthikraja Kalaimani Syncfusion Team September 3, 2021 02:16 PM UTC

Hi Nguyen,

Sorry for the inconvenience caused. 

We need some more time to analyze the issue with source level. So, we will update the further details on or before 8th September 2021. We appreciate your patience until then. 

Regards,
Karthik Raja


KK Karthikraja Kalaimani Syncfusion Team September 8, 2021 02:47 PM UTC

Hi Nguyen, 

Sorry for the inconvenience caused. 

We need some more time to analyze the issue, due to its complexity. We will update further details on or before 13th September 2021. We appreciate your patience until then. 

Regards,
Karthik Raja


NK Nguyen Khoa Lu September 8, 2021 03:38 PM UTC

Im waiting every day. Please fix this issue. I think that is a big issue and very difficult to know where is the bug.



KK Karthikraja Kalaimani Syncfusion Team September 9, 2021 02:05 PM UTC

Hi Nguyen, 

Sorry for the inconvenience caused. 

We understand your situation and would like to inform you of this. We discovered the root cause of this issue, which occurs in the SfDataGrid control. So, currently we are analyzing the issue in source level. So, we will update the further details on or before 13th September 2021. We appreciate your patience and understanding. 

Regards,
Karthik Raja


KK Karthikraja Kalaimani Syncfusion Team September 13, 2021 11:23 AM UTC

Hi Nguyen,

We regret for the inconvenience.

We have forwarded to development team to validate the issue . We will update with further details on 15th september 2021. We appreciate your patience and understanding.

Regards,
Karthik Raj





NK Nguyen Khoa Lu September 14, 2021 04:18 AM UTC

I need a lastest day to report with my customer. 

End of this month or End of this year?


Thanks.



MA Mohanram Anbukkarasu Syncfusion Team September 15, 2021 02:35 PM UTC

Hi Nguyen, 

We regret for the inconvenience.  

We have considered this as a defect and logged bug report on this regard. We will revert to with the feedback link and the timeline for the fix on September 16, 2021. We appreciate your patience until then.  

Regards, 
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team September 16, 2021 07:26 AM UTC

Hi Nguyen, 

Thanks for your patience.  

Please find the feedback link for the reported issue below.  


We will include the fix for the issue in our 2021 Volume 3 service pack release which is expected to be rolled our in the end of October. We will let you know once it is available with the fix. We appreciate your patience until then.  

Regards, 
Mohanram A. 



SV Suja Venkatesan Syncfusion Team October 19, 2021 02:58 PM UTC

Hi Nguyen,  

Thanks for your patience.  

We have included the fix for the issue “Flickering issue occurred on horizontal scrolling with SfDataGrid inside SfPullToRefresh" in our latest Weekly Nuget release update version 19.3.0.46 which is available for download NuGet Gallery | Home  

Please let us know if you need further assistance.   

Regards,  
Suja


NK Nguyen Khoa Lu October 20, 2021 08:09 AM UTC

Thanks you. It work fine with demo source. I will check it on my product.


It it very difficulty to determine the cause of error. But you well done.


Thanks



SV Suja Venkatesan Syncfusion Team October 21, 2021 06:55 AM UTC

Hi Nguyen, 

Thanks for the update. 

Please let us know if you need any further assistance. 

Regards, 
Suja. 


Loader.
Up arrow icon