Skip to content

[WinForms] DataGridView no longer resets user default style fonts #20803

@RussKie

Description

@RussKie

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


Issue metadata

  • Issue type: breaking-change

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions