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
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
|
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));
}
} |
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
|
public class GridPage : ContentPage
{ ...... protected async override void OnAppearing() {
base.OnAppearing();
await Task.Delay(100);
this.grid.GetVisualContainer().AndroidScrollOwner.ForceLayout();
} ... |
It work for me on Android. But, how about IOS? Thanks.
Now, Im waiting Syncfusion to fix Scroll lag.
Thanks.
Im waiting every day. Please fix this issue. I think that is a big issue and very difficult to know where is the bug.
Hi Nguyen,
I need a lastest day to report with my customer.
End of this month or End of this year?
Thanks.
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