wpfui
wpfui copied to clipboard
DataGridComboBoxColumn looks wrong in dark mode
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
OS version
Windows 11 Pro 22H2 22621.3085
.NET version
.NET 8.0
WPF-UI NuGet version
3.0.0
Additional context
No response
I don't find any DataGridComboBoxColumn control.
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>
May I ask if you've solved it? How was it resolved?
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.