Problems loading data when font scaling is different from 100 percent

Hi, some of the people using the application have a font scaling different from 100% on their machine.

When scaling is around 120% syncfusion datagrid onDataSourceChanged event crash with this error:


System.ArgumentOutOfRangeException: 9 out of range 0 to 8 (Parameter 'from')
at Syncfusion.WinForms.GridCommon.ScrollAxis.DistanceRangeCounterCollection.CheckRange(String paramName, Int32 from, Int32 to, Int32 actualValue)
at Syncfusion.WinForms.GridCommon.ScrollAxis.DistanceRangeCounterCollection.SetRange(Int32 from, Int32 to, Double distance)
at Syncfusion.WinForms.GridCommon.ScrollAxis.LineSizeCollection.InitializeDistances()
at Syncfusion.WinForms.GridCommon.ScrollAxis.LineSizeCollection.ResumeUpdates()
at Syncfusion.WinForms.DataGrid.TableControl.UpdateRowAndColumnCount(Boolean canGenerateVisibleColumns, Boolean canUpdateRowCount)
at Syncfusion.WinForms.DataGrid.SfDataGrid.SetSourceList(Object itemsSource, DataSourceChangedEventArgs args, Boolean canRaiseEvent)
at Syncfusion.WinForms.DataGrid.SfDataGrid.RefreshViewAndContainer(Object oldValue, Object newValue, Boolean canRaiseEvent)
at Syncfusion.WinForms.DataGrid.SfDataGrid.<>c__DisplayClass1100_0.<OnDataSourceChanged>b__0()
at Syncfusion.WinForms.DataGrid.BusyIndicatorHelper.RunWork(SfDataGrid dataGrid, Action work, BusyIndicatorAction busyIndicatorAction, Boolean showBusyIndicator)
at Syncfusion.WinForms.DataGrid.SfDataGrid.OnDataSourceChanged(Object oldValue, Object newValue) at Syncfusion.WinForms.DataGrid.SfDataGrid.set_DataSource(Object value)
at Erp.Preventivi.Forms.Preventivo.LoadVociCosto(Boolean updateTot) in D:\Lavoro\Progetti .NET\VS2022\ERP_People\Erp\Preventivi\Forms\Preventivo.cs:line 1584


I tried to change application settings from DPIunAware to DPIAware but I have the same problem.

Is there something I can do to fix this?


3 Replies

SB Sweatha Bharathi Syncfusion Team November 7, 2025 11:28 AM UTC

Hi Michele,

We have reviewed your query. Based on the information you provided, we tried to replicate your scenario. From the call stack you shared, we suspect that you are changing the data source at runtime. We attempted this by changing the data source at runtime, but we were not able to replicate the reported scenario using 120% scaling. In all scaling and resolution settings, it is working fine as expected.

We have provided a sample for your reference. To proceed further, kindly share the details for the queries below:

  1. Could you please confirm if you are facing the issue while changing the data source at runtime?
  2. Could you please confirm if you are facing the issue in all resolutions and scaling settings?
  3. Could you please confirm if you are facing the same issue using our provided sample?
  4. Kindly share details about any customizations other than the provided sample that might be required to replicate your scenario.
  5. If possible, please modify the sample to replicate your reported scenario and share the details about the replication procedure along with a video reference.

This information will help us proceed further and provide a solution.


Regards,
Sweatha B

Attachment: DataGridDemo_a6fa5c82.zip


MI Michele November 7, 2025 12:01 PM UTC

First of all I see your project is a.NET Framework WinForms, while we are using a .NET CORE 9.0 project.

Second, and I don't know if this is part of the problem, we use a custom user control with grid and toolstrip. I attach user control code here.

In windows 11 I change font dimension:

Image_9143_1762516297634

I have the error loading the datasource or changing it:

Image_4200_1762516723232

where the object is a really simple one:

Image_9609_1762516781459

Regards

Michele


Attachment: MyGrid_914831a3.zip


SB Sweatha Bharathi Syncfusion Team November 10, 2025 12:38 PM UTC

Michele,

We have reviewed your provided code snippet and understand that you have used a UserControl with an SfDataGrid and changed the font dimension to 120. However, we were not able to replicate your scenario using both ObservableCollection and DataTable (loading data asynchronously) during both initial loading and when changing the data source at runtime. It works as expected with the font dimension set to 120.
We have provided a sample for your reference. Kindly review the sample, and to proceed further, please provide the following details:
  1. Could you confirm whether you are able to replicate the same scenario using our provided sample?
  2. Based on your provided image, it appears you have used a different CultureInfo. Could you share details about your language settings?
  3. Kindly share details about any customizations other than those in the provided sample that might be required to replicate your scenario.
  4. Please modify the provided sample to replicate your scenario.
This information will help us proceed further and provide an accurate solution.

Attachment: sample_26a9416f.zip

Loader.
Up arrow icon