Hi,
I have a grid with some cells with the style property set to ColumnStyle.FormattedText.
When I click on one of the cells that has the style sett to FormattedText on a row that is already selected, the row is deselected and the highlighting goes away.
I have verified that I have the CellClickAction property set to RowSelect.
Is there a way to keep the row selected?
Thanks
A little more information.
The reason I set the cell style to FormattedText is that I want the value to look like a hyper link.
If I set un-formatted text as the cell value the row stays selected/highlighted when I click on it.
However, if I format the text with the following format: "<a><font color=\"black\">Text text</font></a>"
The row is un-selected/un-highlighted.
Setting the Cell style to URI is not an option, do to the application requirements.
Hello Harlan,
First of all, this is expected behavior. We are internally force the cell to activate when column’s Style is FormattedText, there is a link in the cell's formatted text and user clicks over this link. We do this because if the cell is not active LinkClicked event of the FormattedLinkEditor will not fire. As long as the cell is activated it paints over the row and it seems like the row is not selected anymore.
On second place you can work around this in two ways, depending on your application logic:
e.Layout.Override.ActiveCellAppearance = e.Layout.Override.SelectedRowAppearance;
private void UltraGrid1_BeforeCellActivate(object sender, Infragistics.Win.UltraWinGrid.CancelableCellEventArgs e){ if(e.Cell.EditorResolved is FormattedLinkEditor) e.Cancel = true;}
Attached is a small sample project showing how you can work around this behavior of the grid.
Please check my sample and let me know if any additional questions arise.
Hi Harlan,
I am glad to hear you have resolved your issue. If what you need is only to underline the link your approach is probably the best one in this case.
Please let me know if you need any further assistance.
Thank you for your quick response.
Since I do not need to handle the LinkeClicked event I tried your second solution.
For whatever reason, it did not work from me. Even though I canceled the Cell Activate event, the row was still de-activated.
Since I did not actually need to use a link, I changed the format to underline the link: "<u><font color=\"black\">"Test text"</font></u>"
This seems to work for me.