Tooltip in export buttons

6 posts, 0 answers
  1. MBEN
    MBEN avatar
    203 posts
    Member since:
    Nov 2011

    Posted 05 May 2014 Link to this post

    Hi,

    I am using exportbuttons in the commanditemsetting to handle exports in my grid. I need to show a tooltip on thehover of export images but I am unable to do so as shown in this example http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/export-word-csv/defaultcs.aspx

    Below is my grid declaration:

    <telerik:RadGrid ID="rgBalances" runat="server" DataSourceID="_dataSrcBalances" EnableViewState="false"                         OnPreRender="rgBalances_PreRender" OnItemCommand="rgBalances_ItemCommand"                        OnItemDataBound="rgBalances_ItemDataBound" OnItemCreated="rgBalances_ItemCreated">
           <MasterTableView TableLayout="Fixed" HierarchyDefaultExpanded="true" CommandItemDisplay="Top"
            DataSourceID="_dataSrcBalances" Name="AccountBalance" EnableNoRecordsTemplate="true"
            DataKeyNames="AccountID">
                  <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false"     ShowExportToExcelButton="true"   ShowExportToPdfButton="true" ShowExportToWordButton="true" ShowExportToCsvButton="true" />
                                <Columns>                              
                                </Columns>                         
                            </MasterTableView>
                            <ExportSettings ExportOnlyData="true" IgnorePaging="true" FileName="Activity" OpenInNewWindow="true">
                                <Pdf PaperSize="A4" PageLeftMargin="5px" PageRightMargin="5px" PageWidth="297mm"
                                    PageHeight="210mm" />
                            </ExportSettings>
                        </telerik:RadGrid>
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 May 2014 in reply to MBEN Link to this post

    Hi,

    You can set the tooltip for export buttons using its Text property. Please try the following code snippet.

    ASPX:
    <CommandItemSettings ShowExportToExcelButton="true" ExportToExcelText="Your Text" />

    Thanks,
    Princy
  3. MBEN
    MBEN avatar
    203 posts
    Member since:
    Nov 2011

    Posted 06 May 2014 in reply to Princy Link to this post

    When I use that I don't get a tooltip. Just the text is displayed next to the button.
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 May 2014 in reply to MBEN Link to this post

    Hi MBEN,

    Please try setting it from code behind as follows:

    C#:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
      if (e.Item is GridCommandItem)
      {
       GridCommandItem cmdItem = (GridCommandItem)e.Item;
       Button imbExcel = (Button)cmdItem.FindControl("ExportToExcelButton");
       imbExcel.ToolTip = "Excel ToolTip";
       Button imbPdf = (Button)cmdItem.FindControl("ExportToPdfButton");
       imbPdf.ToolTip = "PDF ToolTip";
       Button imbWord = (Button)cmdItem.FindControl("ExportToWordButton");
       imbWord.ToolTip = "Word ToolTip";
       Button imbCsv = (Button)cmdItem.FindControl("ExportToCsvButton");
       imbCsv.ToolTip = "CSV ToolTip";
      }
    }

    Thanks,
    Princy
  5. Kalai
    Kalai avatar
    6 posts
    Member since:
    May 2019

    Posted 30 Sep in reply to Princy Link to this post

    Hi Princy,

    I tried the below line to set tooltip on Excel icon. But its not showing tooltip. Please provide me the solution.

    <CommandItemSettings ShowExportToExcelButton=""  ExportToExcelImageUrl="../MyUrl/img.png" ExportToExcelText="Tooltip Text"/>

  6. Rumen
    Admin
    Rumen avatar
    14100 posts

    Posted 02 Oct Link to this post

    I tested the solution and can confirm that it works as expected:

    	<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AllowPaging="true"
    			PageSize="7" AutoGenerateColumns="false" OnExcelMLWorkBookCreated="RadGrid1_ExcelMLWorkBookCreated"
    			OnItemCreated="RadGrid1_ItemCreated" OnHTMLExporting="RadGrid1_HtmlExporting" OnItemCommand="RadGrid1_ItemCommand"
    			OnBiffExporting="RadGrid1_BiffExporting">
    			<MasterTableView CommandItemDisplay="Top">
                    <CommandItemSettings ShowExportToExcelButton="true" ExportToExcelText="Tooltip text" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
    				<Columns> ...

    For your convenience I have attached a video demonstration.

    Regards,
    Rumen
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top