dotnet / dotnet/winforms

Form's forecolor overwrite DataGridView cell's forecolor

Open
#11,065 4 comments 1 reaction 0 assignees View on GitHub
area-controls-DataGridView enhancement
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

### .NET version

.NET 9.0.100-preview.3.24165.20

### Did it work in .NET Framework?

No

### Did it work in any of the earlier releases of .NET Core or .NET 5+?

No, It also reproduce on .NET 6.0.

### Issue description

The DataGridView cell's forecolor should be fore color setting in DataGridView defaultcellstyle, not form's forecolor.

### Steps to reproduce

1. Create Winform .NET Core project.
2. Set Form's forecolor as red.
3. Add DataGridView.
4. Click Add Column… in DataGridView Tasks to add a DataGridViewTextBoxColumn.
5. Set DataGridView DefaultCellStyle's forecolor to Lime.
6. Build and run app.
7. Input text and observe test color.

https://github.com/dotnet/winforms/assets/130345015/3ed54d2f-0638-4a57-9dfc-b8fab69e78b3

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.