I know that there is a limitation of the WebExcelExporter in that it does not export templated columns, but I was trying to get the link out of the event args to extract the text, but it's set to an empty string.
Does anyone know how I can extract the link text into a spreadsheet?
Thanks
Alex
Hi Alex,
Thank you for posting in the community.
A possible approach in this scenario is to have a hidden UnboundField in your grid to keep the text values of your templated column's links (this can be achieved by handling the InititalizeRow event). Afterwards, prior to exporting the grid, the templated column may be hidden while the unbound field made visible, which should give you the desired result in the exported document.
Please let me know if this helps.
Nearly, but not there. My first problem is how do I assign the "shown" value to the "hidden" value in the InitializeRow event. I have Link and LinkH columns in the grid, but the following does not work:
e.Row.Items.FindItemByKey(
"LinkH").Text = e.Row.Items.FindItemByKey("Link").Text;
Secondly, I do as you suggested: hide the visible column (Link) and display the hidden column (LinkH), but even if I assign a static value in the InitializeRow, it still comes our as null in the exported control.
I've attached my project to an existing case since it's larger than the allowed size in the open forums(CAS-93073-XPBH2D).
Thank you for your reply.
I can see that your other support ticket has also been attended to, however I am also posting here a very small simplified sample illustrating this scenario. Here the link's text is exported, however the navigateURL may also be dispayed in the exported document if needed.
Please feel free to contact me if you have any further questions.
I'm having issues opening the zip file. The way I resolved the issue is to create a bounded column and hide it. In the button click event, I hide the templated column and display the bounded column.
Glad that the issue has been resolved. Please feel free to contact me if you have any further queries regarding this matter.