How to change text color of selected row

1 Answer 11 Views
DataGrid
Larry
Top achievements
Rank 1
Iron
Iron
Veteran
Larry asked on 30 Sep 2025, 07:35 PM
My background is dark. The selected row uses dark text. How do I change that?

1 Answer, 1 is accepted

Sort by
0
Denis
Telerik team
answered on 01 Oct 2025, 10:51 AM

Hello Larry,

Thank you for raising this question.

When a dark background is used, the selected row text may not be visible, because without theming by default the selected text has a hex: "#000000", which is black. This can be addressed by applying the SelectedTextColor property. The steps are as follows:

1. Apply the SelectedTextColor property into the style resources:

To avoid repeating the same style for every column, define it once in the page's resource dictionary.

<ContentPage.Resources>
    <Style x:Key="DefaultTextCellStyle" TargetType="telerik:DataGridTextCellAppearance">
        <Setter Property="TextColor" Value="White" />
        <Setter Property="SelectedTextColor" Value="Yellow" />
    </Style>
</ContentPage.Resources>

2. Reference the style in the columns:

By applying the same style across columns, the entire row will appear with the desired color of the text uniformly when selected.

<telerik:DataGridTextColumn PropertyName="Name"
                            HeaderText="Name"
                            CellContentStyle="{StaticResource DefaultTextCellStyle}" />

<telerik:DataGridTextColumn PropertyName="Age"
                            HeaderText="Age"
                            CellContentStyle="{StaticResource DefaultTextCellStyle}" />

3. Optional: Use Telerik Theming

For broader consistency across the application, Telerik Theming can be combined with this approach.

Hope this helps.

Regards,
Denis
Progress Telerik

Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings.
Start the 2025 Survey
Tags
DataGrid
Asked by
Larry
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Denis
Telerik team
Share this question
or