This is a migrated thread and some comments may be shown as answers.

GridView Export Cell ToolTip

3 Answers 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris Andrews
Top achievements
Rank 1
Chris Andrews asked on 28 Jan 2015, 05:37 PM
Hello All,

I am currently exporting a grid to ExcelML.  Based on the columns UniqueName, I need to export the cells tool tip rather than the value itself.

I am already handling the ElementExporting event from the grid, but I am failing to see a property or method I can use to get the cell's tool tip.  e.Context is the GridViewDataColumn, not the cell itself.

Has anyone had a need to support something like this or provide some quick hints?

Thanks,
Chris

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 30 Jan 2015, 12:01 PM
Hello Chris,

You can try handling ElementExporting event and set the Value from the argument to the one you want. As for setting the ToolTip, it depends on how it is defined. If it is at column level, then you can find it easily and do the following:
public void OnExporting(object sender, GridViewElementExportingEventArgs e)
        {          
            if (e.Element == ExportElement.Cell)
            {
                e.Value = (e.Context as GridViewDataColumn).ToolTip;
            }
        }


Regards,
Maya
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Chris Andrews
Top achievements
Rank 1
answered on 03 Feb 2015, 02:43 PM
Thank you for the info.  Unfortunately, we needed to define this in a CellStyleSelector. (it's a column we display and image in and change the tooltip based on certain data factors)

I could create a small application demonstrating the behavior if you would like.
0
Maya
Telerik team
answered on 05 Feb 2015, 09:12 AM
Hi Chris,

The thing is that you need to know the value of the ToolTip at the time of exporting and based on the exporting element, to set it as to e.Value. 


Regards,
Maya
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Chris Andrews
Top achievements
Rank 1
Answers by
Maya
Telerik team
Chris Andrews
Top achievements
Rank 1
Share this question
or