Is it possible to have a cell in the grid display some textual content followed by a line break and then a series of clickable hyperlinks?
Something like the image below:
Thanks-Szymon
Yes, the UltraFormattedTextEditor control supports that, so a grid column with a Style of 'FormattedTextEditor' should as well. You would assign a value like this to the cell:
string cellValue = "<a title=\"Click for link1\" href=\"www.link1.com\">link1</a>"; cellValue += "<a title=\"Click for link2\" href=\"www.link2.com\">link2</a>"; cellValue += "<a title=\"Click for link3\" href=\"www.link3.com\">link3</a>";
I apologize I should have been more specific. I'd like the links to invoke handlers in my code, not link to a web page.
Hi Szymon,
You don't have to do that. You can still use FormattedText. But since the formatted text is opaque to the grid, you would have to use an editor.
What you do is place an UltraFormattedTextEditor control on the form with the grid. Set the EditorComponent/EditorControl property on the grid column to this UltraFormattedTextEditor. Then you can set the value of the cell to some formatted XML with links in it. When the user clicks on one of those links, the LinkClicked event on the UltraFormattedTextEditor will fire and you can respond however you like based on the information provided by the link.
I was thinking of approaching this problem by solving the more generic problem of using a creation filter to insert additional text elements into the cell, styling the text elements as links and handling the ElementClick event. The problem now is that I am having problems forcing the row height to be large enough to fit all those controls into it.
The code below doesn't seem to do anything:
e.Layout.Override.RowSizing = RowSizing.Free;e.Layout.Override.CellMultiLine = DefaultableBoolean.True;e.Layout.Override.DefaultRowHeight = 40;e.Layout.Override.MinRowHeight = 40;