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

Adding Tooltip to GridTemplateColumn with JavaScript

1 Answer 172 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 08 Aug 2018, 01:58 PM
We have a column header that looks like this:
    <telerik:GridTemplateComlumn DataField="Venues" HeaderText="Venue">

 

I would like to add a tooltip to this column header but have been having a hard time figuring out a way to do this in JavaScript.
I have tried using the following scripts:

document.querySelectorAll("[value=Venue]").setAttribute('title', 'this is a tooltip');
$("[value=Venue"]).prop('title', 'this is a tooltip');
$("[HeaderText=Venue").prop('title', 'this is a tooltip');

I understand that telerik has findControl() and findElement() to help with element selection, but haven't had too much luck with those either.

Does anyone know a way that I can select this specific column header with JavaScript and apply a tooltip (title)?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Aug 2018, 07:34 PM
Hi David,

I believe the following question and answer is very close to your case: https://www.telerik.com/forums/radtooltip-manager-on-radgrid-column-header#0dRRHdn4qEGjE1dNmFCsKQ. The other option is to loop the th elements in the RadGrid with jQuery and check their text content until you get the desired header text value, so you can change the title attribute of the targetted th element.


Regards,
Marin Bratanov
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
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or