[Solved] Cell Foreground Color Appears Not to Update After Deselecting a Row in Multi-Selection Mode with Fluent Theme

1 Answer 58 Views
GridView
Shiori
Top achievements
Rank 2
Iron
Shiori asked on 05 Aug 2026, 08:03 AM

Environment

  1. Telerik UI (RadGridView)
  2. Theme: Fluent / FluentDark
  3. Multiple row selection enabled

Issue

When multiple rows are selected in a RadGridView and one of the selected rows is subsequently deselected, the text in some cells of the deselected row appears to disappear.

The cell values still exist and are rendered correctly after another repaint occurs, such as when selecting a different row.

Steps to Reproduce

  1. Apply the Fluent theme.
  2. Select multiple rows.
  3. Deselect one of the selected rows.
  4. Observe that some cells in the deselected row appear blank.
  5. Select another row and notice that the text is displayed again.

Investigation Results

While the row is selected, the appearance is correct:

  • Background: Selected color
  • Foreground: White

However, after deselection:

  • The background is updated correctly to the unselected color (White).
  • The foreground appears to remain White, as it was in the selected state.

As a result, the cell seems to have:

BackColor = White

ForeColor= White

making the text effectively invisible.

Behavior with FluentDark Theme

The same steps do not produce a visible issue when using the FluentDark theme.

However, based on our investigation:

  • BackColor= Black
  • ForeColor = White

It appears that the foreground color may also remain in the selected-state color after deselection in FluentDark.

When the theme is subsequently switched from FluentDark to Fluent, the issue becomes visible because the colors effectively become:

BackColor= White

ForeColor = White

and the text can no longer be seen.

Expected Behavior

When a row is deselected, the cell foreground color should be properly restored to the default color for the unselected state.

Question

Is it necessary to explicitly reset the ForeColor in events such as CellFormatting or RowFormatting, or is this behavior considered a bug in the Fluent/FluentDark themes?

Attachments

  1. Three screenshots demonstrating the issue with the Fluent theme.(1-3)
  2. Three screenshots demonstrating the issue when switching from FluentDark to Fluent.(4-6)

Based on the screenshots, the background color appears to be updated correctly, while the foreground color of only some cells remains in the selected-state color until a repaint occurs, after which the display returns to normal.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 07 Aug 2026, 12:37 PM

Hello, Shiori,

I can not observe this behavior on my side in a sample demo project with Fluent/FluentDark theme. Maybe there is something different in your setup that is missing on my side.

Explicit ForeColor Reset in CellFormatting: Is it necessary to explicitly reset the ForeColor in events such as CellFormatting or RowFormatting?

Yes, it is necessary to explicitly reset the ForeColor in the CellFormatting (or RowFormatting) event or any property when customizing cell appearance in RadGridView, especially with UI virtualization enabled. RadGridView reuses cell elements for performance, so any customizations to properties like ForeColor must be explicitly set for all relevant states (selected, unselected, etc.). This is also noted in our documentation here: https://www.telerik.com/products/winforms/documentation/controls/gridview/visual-elements/cells/formatting-cells 

In your scenario, you should always set the ForeColor for both selected and unselected states in the CellFormatting event. Here’s an example:

private void RadGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    var rowElement = e.CellElement.RowElement;
    if (rowElement == null)
    {
        return;
    }

    if (rowElement.IsSelected)
    {
        e.CellElement.ForeColor = Color.White; // Selected state
    }
    else
    {
        e.CellElement.ForeColor = Color.Black; // Unselected (default) state
    }
}

Further details

In case, you are still experiencing the same issue, I would need to investigate your custom code implementation to assist you further. It would be great if you can provide me with a sample project where this issue happens? Thus, I could be able to investigate the specific case in more details. It is not normal to have disappearing text from cells but I need to investigate what exactly is causing it.

    Regards,
    Nadya | Tech Support Engineer
    Progress Telerik

    Modernizing a WinForms application? Use the AI-powered WinForms Converter to simplify migration to Telerik UI for WinForms.
    Shiori
    Top achievements
    Rank 2
    Iron
    commented on 10 Aug 2026, 08:41 AM

    Thank you for your response. I tried it, but in the FluentDark theme, the background color and text color become the same when a row is not selected.

    Could the following code be causing this issue?

    if (e.CellElement.RowInfo.IsSelected)
    {
    e.CellElement.DrawFill = true;
    e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
    }
    else
    {
    e.CellElement.DrawFill = false;

    }

    I added this setting because when multiple rows are selected and then one row is deselected, the row appearance does not behave as expected. Could this customization be affecting the display behavior?
    Nadya | Tech Support Engineer
    Telerik team
    commented on 10 Aug 2026, 01:25 PM

    Hello, Shiori,

    I applied the FluentDark theme to a RadGridView, but I am not able to observe that the background color and text color become the same when a row is not selected. See the attached gif file that demonstrates the behavior on my side when I select/deselect rows. This is default behavior. 

    Are you experiencing behavior other than that? If yes, is it possible to provide me with a sample project that can demonstrate your existing setup? Thus, I could be able to investigate the different behavior.

    I also tested the provided code snippet, but it isn't causing the behavior that you described. This is why providing a sample project with your setup would be of great help.

    Looking forward to your reply.

    Shiori
    Top achievements
    Rank 2
    Iron
    commented on 12 Aug 2026, 02:21 AM

    Your initial response resolved the issue. The root cause was that ViewCellFormatting reset the ForeColor property, which disrupted the state management handled by CellFormatting. Thank you for your support.
    Tags
    GridView
    Asked by
    Shiori
    Top achievements
    Rank 2
    Iron
    Answers by
    Nadya | Tech Support Engineer
    Telerik team
    Share this question
    or