dotnet / dotnet/winforms

Editing form with DataGridView causes many unwanted changes

Open
#13,170 14 comments 1 reaction 0 assignees View on GitHub
area-VSDesigner
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### Environment

All

### .NET version

.Net 9.0

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

Framework.

### Issue description

The WinForm designer for DataGridView adds additional row and column styles with every edit of the form (even if DGV is untouched) and creates new DataGridViewStyles with every edit. After first edit they are numbered 1 to N, next edit N to 2N, next edit 1 to N again if you don’t add any new styles. If you do the numbering gets more mixed up. The file size grows rapidly and it’s difficult to use Git difference because there are so many changes that need to be deleted.

### Steps to reproduce

Create a for with DataGridView and anything else, edit anything and save. Upload to GitHub, edit anything, except DGV and save. Do diff and you will see many changes. Edit anything and you will see fewer diffs against GitHub. Each edit/save will cause unwanted changes.

### Diagnostics

```text

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.