Home Forums WinForms controls Xceed Grid for WinForms Dynamic selection forecolor

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16841 |

    I have a grid containing cells with text in different colors. I want each cell’s text to retain its color when selected. However, the SelectionForeColor property appears to be static and settable only at the grid level, belonging only to GridControl, DetailGrid, and GridStyle objects. What’s the best way to retain the ForeColor of my cells when I select them?

    Imported from legacy forums. Posted by Aaron (had 1931 views)

    User (Old forums)
    Member
    Post count: 23064

    Unfortunately, this is not possible.  Changing the SelectionForeColor changes it for the whole row.  And setting it to Transparent means the text will not be visible.

    The only thing I see you could do is to set the SelectionForeColor to the ForeColor of the CurrentCell when its changes.

    e.g.:

        void gridControl1_CurrentCellChanged( object sender, EventArgs e )
        {
          gridControl1.SelectionForeColor = gridControl1.CurrentCell.ForeColor;
        }

    Imported from legacy forums. Posted by André (had 168 views)

    User (Old forums)
    Member
    Post count: 23064

    That won’t fly, unfortunately, since I allow multiple selection within the grid and sometimes rows will have different text colors. I guess you can consider this post a request for finer control over color properties, preferably at the cell level.

     Thanks,

    Aaron

    Imported from legacy forums. Posted by Aaron (had 2504 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.