Hi,I want to color a part of the text in a cell. I achieve this using ColumnStyle.FormattedText and html to set the color. However, this doesn't work when the cell is disabled. The text color always stays gray.I've tried to use CellActivation.NoEdit and set the part of the text that should not be colored to SystemColors.GrayText, but then the cell activates on click. Setting the CellClickAction to something else doesn't resolve this.Can anyone point me in the right direction how to set part of a text color in a disabled cell?Thanks in advance.Vabi (TorX)
I understand it's by design, but I was hoping there was something to work around that like the ForeColorDisabled property on the Appearance object (which I can't use unfortunately because only a part of the text should be colored).
Your solution however looks nice. However when I click on a cell, the row still gets activated. I've tried to set CellClickAction to CellSelect, but that didn't work. Then I downloaded your solution to see if you worked around that, but I can't open the zip (it looks like it's corrupted).
Thanks for your help!
This behavior is by design, the logic being if we didn't gray out the text, the user might be mislead into thinking they can navigate to a URL or something (a popular use case for the FormattedText style is to show hyperlinks).
In my opinion, the easiest way to solve this problem is to set the cell's Activation to ActivateOnly, so that it doesn't go into edit mode, and handle/cancel the BeforeCellActivate event, so that clicking on a cell in that column does not activate it.
The attached sample demonstrates how to do this.