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

RadToolTip for mulitple datakeyname

4 Answers 99 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
SoniTek
Top achievements
Rank 1
SoniTek asked on 10 Nov 2012, 07:42 AM
Hello,

This line work for a single DataKeyNames

RadToolTipManager1.TargetControls.Add(gridItem(column.UniqueName).ClientID, (TryCast(e.Item, GridDataItem)).GetDataKeyValue("MasterNum").ToString(), True)

Is there away to code this for multiple DataKeyNames eg.

 

DataKeyNames("MasterNum,LodgeNum")

 

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 13 Nov 2012, 11:13 AM
Hi,

This functionality is part of the RadGrid and not of the RadTooltip. It is controlled by the DataKeyNames property of the MasterTableView of RadGrid. You can see it in action in this online demo with the tooltip manager. You can simply add more key names there.

What I can also suggest is using the approach from this demo to get the data from more columns: http://demos.telerik.com/aspnet-ajax/tooltip/examples/databasetooltipswithoutlod/defaultcs.aspx.


Greetings,
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
SoniTek
Top achievements
Rank 1
answered on 13 Nov 2012, 03:05 PM
Hello Marin,

Thank you for the quick reply and the examples does help understanding however, I need the tooltip control to query the database for the combination of two fields.

Thanks,
0
Accepted
Marin Bratanov
Telerik team
answered on 14 Nov 2012, 12:56 PM
Hello,

The tooltip only takes a string for its value. How the string is created is the developer's decision and task. You can query your database wit your code and return a value to pass to the tooltip.

In case you want to have the tooltip load content based on both keys - you can concatenate the strings with a special character inbetween (e.g. a | symbol) and in the OnAjaxUpdate event the tooltip manager offers you can split the Value that is passed, get your keys and query your database again. See this demo for another example of this logic.


Greetings,
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
SoniTek
Top achievements
Rank 1
answered on 15 Nov 2012, 03:24 PM
Thanks Marin.

It is working now. Did exactly what you have mentioned.

1. Concatenate the 2 values for the tooltip targetcontrol
2. Split the values OnAjaxUpdate and query the database filter by the two values.
Tags
ToolTip
Asked by
SoniTek
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
SoniTek
Top achievements
Rank 1
Share this question
or