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

Tooltip in export buttons

5 Answers 129 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MBEN
Top achievements
Rank 2
Veteran
MBEN asked on 05 May 2014, 10:02 PM
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>

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 May 2014, 05:18 AM
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
0
MBEN
Top achievements
Rank 2
Veteran
answered on 06 May 2014, 05:18 PM
When I use that I don't get a tooltip. Just the text is displayed next to the button.
0
Princy
Top achievements
Rank 2
answered on 07 May 2014, 04:52 AM
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
0
Kalai
Top achievements
Rank 1
answered on 30 Sep 2019, 05:00 AM

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"/>

0
Rumen
Telerik team
answered on 02 Oct 2019, 01:19 PM

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.
Tags
Grid
Asked by
MBEN
Top achievements
Rank 2
Veteran
Answers by
Princy
Top achievements
Rank 2
MBEN
Top achievements
Rank 2
Veteran
Kalai
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or