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

tooltip on hover of radgrid column label

4 Answers 395 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
sandeep
Top achievements
Rank 1
sandeep asked on 20 Jun 2008, 07:07 AM
Hello all, 
  
          I am new to using telerik rad controls and i am really excited now to use them. Can anybody post a sample code on how to attach the tooltip to a label which is the first template column in my radgrid. Hovering over this competencyname should display its corresponding info. Can i get a sample code here.

code

<telerik:GridTemplateColumn>

<ItemTemplate>

<asp:Label ID="lblComp" Text='<% #Eval("CompetencyName") %>' runat="server"></asp:Label>

<!-- POP Up control for displaying competency info -->

<telerik:RadToolTipManager runat="server" ID="RadToolTip3" Height="240px" Width="500px"

TargetControlID="lblComp" IsClientID="true" OffsetY="4" Sticky="true" Animation="Fade"

Position="BottomCenter" RelativeTo="Element" Skin="Telerik" OnAjaxUpdate="OnAjaxUpdate">

</telerik:RadToolTipManager>

<!-- end of pop up control for displaying info -->

</ItemTemplate>

</telerik:GridTemplateColumn>

I have just tried displaying a tooltip with some text but nothing is being displayed.please help i did not understand the sample already provided by telerik.
I am developing dnn modules

Thanks,
Sandeep.M

    

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 23 Jun 2008, 12:28 PM
Hi Sandeep,

Try setting the ToolTip as shown below.

ASPX:
 <telerik:GridTemplateColumn UniqueName="TempCol" > 
                       <ItemTemplate> 
                           <asp:Label ID="Label2" runat="server" Text='<%#Eval("ValueCol") %>' ></asp:Label> 
                       </ItemTemplate> 
                     </telerik:GridTemplateColumn> 

CS:
protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            Label lbl = (Label)item["TempCol"].FindControl("Label2"); 
            item["TempCol"].ToolTip = lbl.Text; 
        } 
   } 


Thanks
Shinu.
0
Svetlina Anati
Telerik team
answered on 23 Jun 2008, 12:42 PM
Hello sandeep,

I suggest to examine our online demos which how to tooltipify a grid by using RadToolTipManager and RadToolTip. I believe that our new online example which shows the difference and manner of using these two controls will be helpful - you can find it here.

Regards,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Justin
Top achievements
Rank 1
answered on 13 Feb 2012, 09:52 PM
These examples do basically exactly what I want but are made overly complex by binding the tooltip text to data, etc... Also, they use the asp grid instead of the RadGrid. Why? What if I simply want to display a simple line of text when the user hovers a specific column or row inside a RadGrid?  I'd like to be able to control what the line of text says in the code behind file, without having to bind it to a data source, etc.  Please help.
0
Richard
Top achievements
Rank 1
answered on 14 Feb 2012, 04:07 PM
Justin:

Depending on your scenario, an approach to consider would be to AutoToolTipify your Grid. You can reference the ToolTip/AutoTooltipify online demo for insights on positioning tooltips and setting text properties in server-side script.

Also reference the Add RadTooltip to entire row of radgrid, NOT just cell  for additional insights.

Hope this helps!
Tags
ToolTip
Asked by
sandeep
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Svetlina Anati
Telerik team
Justin
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or