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

TooltipManager Pass values back and forth onAjaxUpdate

3 Answers 143 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Sharbel Lutfallah
Top achievements
Rank 1
Sharbel Lutfallah asked on 03 Dec 2007, 05:05 AM
What is the best way to pass values back and forth to onAjax update when using a ToolTipManager?  For example, in this sample : http://www.telerik.com/DEMOS/ASPNET/Prometheus/ToolTip/Examples/LoadOnDemand/DefaultCS.aspx the product data is loaded from what I can see as the index of the repeater/grid which might work for this example, but really wouldnt work for a real-world example.

In my last task, the requirements were similar to the above, and I had a hidden field that I would update with the ProductID on click which woudl then be retrieved in the onAjaxUpdate event of the ToolTipManager.  It doesnt strike me as the best solution, but it does work.

Question:  in the AjaxUpdate event, we can get the targetControlID which is the clientID but can get an actual reference to the control somehow?  My initial thoughts are to have the productID databound in each image button as the CommandArguement, so I would like to get a reference to the Image Button that triggered the window opening, grab the command arguement and populate the tooltip with the Usercontrol as per the sample.

Any insight on how best to pass values or get references to controls inside the grids would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 06 Dec 2007, 03:12 PM
Hi Sharbel Lutfallah,
Actually, in the example you refer to, we set the ID of the images to the productID of the products. Thus, in the AjaxUpdate handler, we can use the ClientID of the images (e.TargetControlID) to get their ID, which is the productID. This approach should work in your case as well.

I have attached a simple project, demonstrating how you can get a reference to an imagebutton (in a DataList) in the AjaxUpdate handler of the RadToolTIpManager. The basic idea is to use the ClientID of the imagebutton to find the index of the item, holding our target control, and then use the FindControl method for that item to get a reference to the imagebutton.

I understand that having to make such calculations is not very intuitive, but we have on our TODO list the idea to add another overload of the Add method for the TargetControls collection that will receive a third parameter. This third parameter will then be available in the AjaxUpdate handler as another argument. Once we implement this, you will be able to pass the productID directly as an argument to the AjaxUpdate handler.

Sincerely yours,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Oliver
Top achievements
Rank 1
answered on 02 Feb 2008, 04:56 PM
Hi Tsvetie,

Was this TODO implemented?  I have the latest version of Prometheus, but I cannot see this additional parameter.

Kind regards,

Oliver
0
Tsvetie
Telerik team
answered on 04 Feb 2008, 04:50 PM
Hi Oliver,
No, this is not implemented in the current official version of the Prometheus suite. The feature is on the TODO list for Q1, scheduled for the middle of April.

Greetings,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
Sharbel Lutfallah
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Oliver
Top achievements
Rank 1
Share this question
or