Dear All,
I have a grid cell which need to display multiple file names as hyperlink and on click, it should open the document from the URL mentioned. What is happening is when i set the columnstyle = columnstyle.URL the text value in the entire cell become hyperlink not differentiating the individual files as hyperlink.
for eg. in a cell i show the value as
\\MyServer\MyDoc.doc
\\MyServer\New.doc
When running the code the text in the entire become as single hyperlink. I want to have different hyperlink for individual files in the cell.
Any help would be greatly appreciated.
Thanks,
Arun.K.S
You can't do this with a style of URL. The URL style will interpret the entire cell contents as a single link (as you said).
What you would have to do is use a Style of FormattedText and then the Value of the cell would have to return XML that provides multiple links.
For example, the cell value would be something like this:
<a href="http://www.Google.com">Google</a><br/><br/><a href="http://www.Infragitsics.com">Infragistics</a>
Dear Mike,
Thank you for your reply. It worked well. But the problem is, when I export the data to excel all the cells are displaying just like a text not as a hyperlink. I used the ultragirdexcelexporter's initializecolumn event to format the column as URL and FormattedText. If I set URL then after exporting to excel the cells were showing all the HTML of the hyperlink. If the style is set as FormattedText then in the excel the cells are just like other cells showing values as \\Myserver\MyDocument.doc not as a hyperlink.
I hope you will give a best solution for this scenario, appreciating your response.
Hi Arun,
There's no way that the GridExcelExporter can convert the XML formatting of the FormattedText cell into something that Excel can understand, except as raw text.
You could handle the CellExported or RowExported event on the GridExcelExporter and then write something into the cell yourself - essentially changing what is exported. And you could assign a formula to the cell and use the Hyperlink function to put a link in a cell. But as far as I am able to determine, Excel does not support multiple hyperlinks within the same cell.