Downgrade in scrolling performance between versions with DataGridTemplateColumn
In my actual project, when we started working, we were on version 30.2.7. We didn't upgrade because there was no need to. We now have a reason to upgrade, but we noticed that are data grid performance in the scrolling aspect has worsened, by a lot. As in, the app is no longer usable.
The root cause of the performance issue is DataGridTemplateColumn, if they have even just a bit of visual elements in them, it causes lag spikes when scrolling fast. I understand template columns are not as optimized as regular ones, but my issue is the decrease in performance between versions. We tried optimizing are data columns, but it is not enough.
Using the datgrid sample, I upped the row amount to 80 and added this column to the datagrid :
<syncfusion:DataGridTemplateColumn MappingName="Icon">
<syncfusion:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<HorizontalStackLayout HorizontalOptions="Fill">
<Ellipse BackgroundColor="Green" />
<Ellipse BackgroundColor="Red" />
<Ellipse BackgroundColor="Blue" />
<Ellipse BackgroundColor="Orange" />
<Ellipse BackgroundColor="Yellow" />
<Ellipse BackgroundColor="Pink" />
<Ellipse BackgroundColor="Purple" />
<Ellipse BackgroundColor="Purple" />
<Ellipse BackgroundColor="Purple" />
<Ellipse BackgroundColor="Purple" />
</HorizontalStackLayout>
</DataTemplate>
</syncfusion:DataGridTemplateColumn.CellTemplate>
</syncfusion:DataGridTemplateColumn>
The lag is presented with also only 5 ellipses; I added more just to make it more obvious.
To test it, you can change the datagrid version between 32.1.20 and 30.2.7.
Attached the sample to this replay.
A bit more information:
The lag is felt in both debug and release. Only tested on windows. The most lag is felt when scrolling quickly, but even regular scrolling feels a bit laggy. My PC specs should not be an issue normally.
Attachment: SlowDataGrid_d0879627.zip
public DataGridFeatures() { InitializeComponent(); dataGrid.CellRenderers["Template"] = new CustomDataGridTemplateRenderer(); } public class CustomDataGridTemplateRenderer : DataGridCellTemplateRenderer { protected override DataGridCell? OnPrepareViews(DataColumnBase dataColumn) { var cell = base.OnPrepareViews(dataColumn); View? content = null; if (dataColumn.DataGridColumn?.CellTemplate is DataTemplateSelector templateSelector) { DataTemplate? selectedTemplate = templateSelector.SelectTemplate(dataColumn.RowData, dataColumn.DataGridColumn); if (selectedTemplate != null) { content = selectedTemplate.CreateContent() as View; } } else if (dataColumn.DataGridColumn?.CellTemplate is DataTemplate template) { content = template.CreateContent() as View; } if (cell != null && content != null) cell.Content = content; return cell; } public override bool CanUpdateBinding(DataColumnBase dataColumnBase) { return false; } } |
<syncfusion:SfDataGrid AllowAsyncScrolling="True" /> |
Muthu Kumar Madasamy.
- 5 Replies
- 2 Participants
-
HA Haywired
- Dec 24, 2025 02:20 PM UTC
- Jan 6, 2026 07:33 AM UTC