GridView Export Cell ToolTip

4 posts, 0 answers
  1. Chris Andrews
    Chris Andrews avatar
    41 posts
    Member since:
    Mar 2010

    Posted 28 Jan 2015 Link to this post

    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

  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 30 Jan 2015 Link to this post

    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.

     
  3. Chris Andrews
    Chris Andrews avatar
    41 posts
    Member since:
    Mar 2010

    Posted 03 Feb 2015 in reply to Maya Link to this post

    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.
  4. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 05 Feb 2015 Link to this post

    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.

     
Back to Top