dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.37k stars 966 forks source link

DataGridView styles designer bugs #8593

Open kirsan31 opened 1 year ago

kirsan31 commented 1 year ago

Environment

All

.NET version

All

Did this work in a previous version of Visual Studio and/or previous .NET release?

No

Issue description

Referenceses: https://developercommunity.visualstudio.com/t/WinForms-DataGridView-styles-designer/1143911 https://github.com/microsoft/winforms-designer/issues/2225

For now DataGridView styles in designer can be split to 3 groups by designer behavior: pic1

Group 1.

Work absolutely correct, but not displaying default values (because they are absent).

Groups 2 and 3.

Have common bugs / incorrect behavior. When you change any parameter in this styles - the designer will wright to *.Designer.cs this parameter new value + ALL other parameters with default values. gif1

This can lead to confusing errors. For example this will break system font scaling because of explicitly font set. Also when you open this styles settings it’s impossible to determinate what are default values and what you have changed (if any): pic2

Group 2.

Didn't not remove all it's code from *.Designer.cs when all changes are removed in designer.

Group 3.

You can’t delete default values from *.Designer.cs - this completely break system font scaling. gif2 And if you delete def. values manually, they will be bring back after any designer manipulation.


Ideal solution will be that Groups 2 and 3 behave identical and:

This will solve all problems above.

dkazennov commented 1 year ago

This issue is put on hold until there will be decisions on #8474 and #8518 (the new task #8599 to define a pattern for default values).