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

RadGrid and Tooltip

8 Answers 885 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 25 Mar 2008, 12:28 AM
I'm using the radgrid and have it as a databound columns.  How can i insert a tooltip on a specific column where each row passes its unique id to web service for the text?

I'm having trouble figuring out how to procede and can't find an example similar to this.  Thanks.

8 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 28 Mar 2008, 07:10 AM
Hello John,

I suggest looking at the following two examples:

Bind To Target
http://www.telerik.com/DEMOS/ASPNET/Prometheus/ToolTip/Examples/BindToTarget/DefaultCS.aspx
This example shows three scenarios of binding the tooltip - and one of them is using Telerik RadGrid with bound columns.

WebService
http://www.telerik.com/DEMOS/ASPNET/Prometheus-futures/ToolTip/Examples/WebService/DefaultCS.aspx
This example from the Futures build demos shows configuring the tooltip to a web-service using the Northwind database.

Essentially what you need to do is combine the two examples. If you feel more comfortable with AJAX,then first implement your code to run with the RadToolTipManager OnAjaxUpdate handler, then replace it with a WebService, as demonstrated in the second example.


Best wishes,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
JustinWong
Top achievements
Rank 1
answered on 24 Dec 2011, 04:52 AM
Hi: I looked at the example. True, one of them showed ToolTip with a grid with bound column. HOWEVER, the ToolTip in this example doesNOT target the boundcolumn. Instead, it targets a template column.  How to you set a RadToolTip for a bound column?  For example, in the demo you referred to, how does one set a RadToolTip for the bound ID column (instead of the templated name column)?
0
Svetlina Anati
Telerik team
answered on 26 Dec 2011, 01:59 PM
Hello Justin,

 

What I suggest is the following:

1) Use the ItemDataBound event in order to be able to reference the items
2) In 1) find the desired particular cell you want to tooltipify
3) Add its client ID to the TargetControls collection

You can see this logic in the demo below (the GridView, tooltipified by the manager, note that this is not a RadGrid but the logic is very similar and you can use it as a start point):


http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultcs.aspx


In case you encounter a problem, let us know and provide more details on the issue and we will do our best to help.

Regards,
Svetlina Anati
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 27 Sep 2012, 02:00 PM
How would one tootipify a grid CELL not a grid row. The example you provided shows a row. I tried getting a reference to the cell clientId in the ItemDataBound event using the following but it didn't work:

Dim dItem As GridDataItem = CType(e.Item, GridDataItem)
 
                myToolTipManager.TargetControls.Add(dItem("colname").ClientID, someValue, True)
0
Marin Bratanov
Telerik team
answered on 28 Sep 2012, 01:50 PM
Hi Albert,

The following help article shows how you can access cells and rows: http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html. Its second section treats your case.

Said shortly, you will need exactly what you supposed:
Me.RadToolTipManager1.TargetControls.Add(CType(e.Item, GridDataItem)("UnitPrice").ClientID, (TryCast(e.Item, GridDataItem)).GetDataKeyValue("ProductID").ToString(), True)

I tried this in the following online demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx?product=tooltip. I am attaching here the file and a video from my test.


Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Waseem
Top achievements
Rank 1
answered on 14 Oct 2012, 03:05 AM
My Dear, use this code to add tooltip to specific column

<telerik:GridTemplateColumn DataField="Message" HeaderText="Message" SortExpression="Message" UniqueName="Message">
                                            <ItemStyle Width="350px"></ItemStyle>
                                            <ItemTemplate>
                                                                   
<asp:LinkButton ID="lnkMessage" CssClass="mylink" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Message") %>' />
                                            <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="lnkMessage" Text="View Detail"
                                                RelativeTo="Mouse" Position="TopLeft" ></telerik:RadToolTip>
                                        
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>

Regards
Muhammad Waseem
0
Luis
Top achievements
Rank 1
Veteran
answered on 15 Jun 2020, 02:49 PM

And how can I add a tooltip for every cell, showing some values related to this cell itself? 

Luis

0
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
answered on 15 Jun 2020, 02:59 PM
Check out Marin's reply in this thread on 9/28/2012. 
Tags
ToolTip
Asked by
John
Top achievements
Rank 1
Answers by
Tervel
Telerik team
JustinWong
Top achievements
Rank 1
Svetlina Anati
Telerik team
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Marin Bratanov
Telerik team
Waseem
Top achievements
Rank 1
Luis
Top achievements
Rank 1
Veteran
Share this question
or