Dear Reader
Precondition: Suppose I have a grid. I have also set the ColumnStyle to FormattedText . The original text in the cell is "Hello World" .First I use "string.Replace("Hello", "<font color=\"red\">Hello</font>") " to change the color of part of the text.
How can I underline the whole text in the cell whatever the value in it?
Then how can I click the underlined text in this cell to trigger an event just like "ClickCellButton"(but I don't want to set the ColumnStyle to Button) , in order that I can get the object of the Cell or Row and do some other functon.
No, I think if you want to control the color, you will have to use a style of FormattedText.
Hi,Mike
If I set the Style of the column to URL. Can I also use "string.Replace("Hello", "<font color=\"red\">Hello</font>") " to change the color of part of the text?
If you want the cell to look and feel like a hyperlink, then you can just set the Style of the column to URL.
Here you can find more information on how to design your text:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.1/CLR2.0/html/WinFormattedLinkLabel_Formatting_Text_and_Hyperlinks.html
You can use the ClickCell event and get the cell from e.Cell and get the row from e.Cell.Row