wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

DataGridComboBoxColumn looks wrong in dark mode

Open saracmert opened this issue 11 months ago • 4 comments

Describe the bug

DataGridComboBoxColumn appears with white background in dark mode. Since the foreground color is white, the texts cannot be read. The problem doesn't occur in light mode.

To Reproduce

Add a DataGridComboBoxColumn in a ui:DataGrid and view the application in light mode.

Expected behavior

The background of the ComboBox displayed with DataGridComboBoxColumn should appear with a dark background color in dark mode.

Screenshots

image

OS version

Windows 11 Pro 22H2 22621.3085

.NET version

.NET 8.0

WPF-UI NuGet version

3.0.0

Additional context

No response

saracmert avatar Feb 27 '24 13:02 saracmert

I don't find any DataGridComboBoxColumn control.

m0lDaViA avatar Mar 12 '24 19:03 m0lDaViA

I fixed the issue in my own project as shown below. However, when I don’t provide EditingElementStyle, ComboBox items appear with both white foreground color and background color in dark mode.

<ui:DataGrid>
    <DataGrid.Columns>
        <DataGridComboBoxColumn Header="Gender">
            <DataGridComboBoxColumn.EditingElementStyle>
                <Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}">
                    <Setter Property="IsDropDownOpen" Value="True" />
                </Style>
            </DataGridComboBoxColumn.EditingElementStyle>
        </DataGridComboBoxColumn>
    </DataGrid.Columns>
</ui:DataGrid>

saracmert avatar Mar 13 '24 21:03 saracmert

May I ask if you've solved it? How was it resolved?

BingGitCn avatar Mar 30 '24 01:03 BingGitCn

May I ask if you've solved it? How was it resolved?

If you provide an EditingElementStyle to the DataGridComboBoxColumn, you can solve the issue.

saracmert avatar Mar 30 '24 20:03 saracmert