-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
DataGridView no longer resets user default style fonts
Version introduced
.NET 5.0 RC2
Old behavior
Whenever ambient font changed DataGridView would reset and override user-defined fonts in DefaultCellStyle, ColumnHeadersDefaultCellStyle, and RowHeadersDefaultCellStyle properties.
New behavior
If a user configures font settings in the DefaultCellStyle, ColumnHeadersDefaultCellStyle, and RowHeadersDefaultCellStyle properties these will retain user settings whenever ambient font changes.
Otherwise font settings in the DefaultCellStyle, ColumnHeadersDefaultCellStyle, and RowHeadersDefaultCellStyle properties will continue to change to match the ambient font settings.
Reason for change
With the change of the default font in .NET Core 3.0 (https://docs.microsoft.com/en-us/dotnet/core/compatibility/winforms#default-control-font-changed-to-segoe-ui-9-pt) it's become a serious impediment for a migration of applications that rely on custom styling in a DataGridView control, and wish to retain the original default font settings from .NET Framework to .NET 5.0.
Recommended action
Category
- Windows Forms
Affected APIs
- https://docs.microsoft.com/dotnet/api/system.windows.forms.datagridview.defaultcellstyle
- https://docs.microsoft.com/dotnet/api/system.windows.forms.datagridview.columnheadersdefaultcellstyle
- https://docs.microsoft.com/dotnet/api/system.windows.forms.datagridview.rowheadersdefaultcellstyle
Issue metadata
- Issue type: breaking-change