I have a RadGridView in my application and did not explicitly set the style for it. It works well in normal contrast mode but when turn on the Aquatic high contrast mode in Windows 11, the contrast between the text and background on the header becomes minimal like below.
I tried changing the style like below but the text will stay at the defined color regardless of the contrast mode.
<Style TargetType="telerik:GridViewHeaderCell" BasedOn="{StaticResource GridViewHeaderCellStyle}"> <Setter Property="Foreground" Value="Red"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style>
Hello boon,
Thank you for the provided images and code snippet.
I tried to replicate the same issue from the first screenshot you provided, however, the RadGridView control is displayed as expected at my end, even with the Aquatic contrast theme:
In addition, the style you provided is also applied as expected at my end:
With this said, can you please have a look at the attached project and let me know how it differs from the setup at your end? If possible, please modify the project to demonstrate the issue and send it back to me so that I can further investigate.
Hi Dilyan,
Thank you for the reply and sample code. I have found what my problem was.
The style of the RadGridView control was set somewhere in the app in resources, however that explicit style (not setting the background and foreground color) did not have a BasedOn GridViewHeaderCellStyle attribute and perhaps the control have no default color that in turn causing the problem.
After setting the BasedOn attribute, the color contrast are preserved as desired.
I'm glad to hear that you've found the source of the issue and managed to resolve it.