Can you give a simple code sample using the showEvent="FromCode" property? I didn't find any documentation on using showEvent with this option and I don't see any method called show().
In my app, when some data changes, I want to show a tooltip informing the user of the change (kind of like a new mail alert from outlook). So I need to programatically show the tooltip as opposed to the user focusing on a control.
Thanks,
Lina
12 Answers, 1 is accepted
Try this code:
function showMyToolTip() { |
var tooltip = $find("<%=myToolTip.ID%>"); |
tooltip.show(); |
} |
In this link there are others methods:
http://www.telerik.com/help/radcontrols/prometheus/tooltip_RadToolTip_client_object.html
Fabio Wada
Thanks for responding. I am looking for server side code. Is there a way to show the tooltip from codebehind?
Thanks,
Lina
You can use script injection. I didn't find other way.
private void Button1_Click( object sender, System.EventArgs e) {
InjectScript.Text= "<script>showMyToolTip()</" + "script>";
}
Fabio Wada.
You can use script injection. I didn't find other way.
private void Button1_Click( object sender, System.EventArgs e) {
InjectScript.Text= "<script>showMyToolTip()</" + "script>";
}
Fabio Wada.
Hi Fabio,
I was able to show the tooltip by injecting this:
InjectScript.Text = "<script type='text/javascript'>Sys.Application.add_load(function(){showMyToolTip()})</" + "script>"; |
In my code I have a RadAjaxPanel in which there is a Timer, the RadToolTip and the InjectScript label. If I create Button1 outside the panel the javascript method is called and the tooltip shows. If I move the button into the panel the javascript method is no longer called.
Any ideas why this is happening?
Eventually I need to show the tooltip from the method that is called by the Timer, hence I need the tooltip to work when it is invoked from inside the Panel.
Thanks,
Lina
If you are using RadAjaxPanel, so you can use this code to show the tool tip from button inside the RadAjaxPanel. The label injection script doesn't work called from RadAjaxPanel.
protected void Button1_Click(object sender, EventArgs e) { |
RadAjaxPanel1.ResponseScripts.Add("showMyToolTip();"); |
} |
I hope that this code help you.
Fabio Wada
FYI, for Q1 2008 release we plan some handy new features to RadToolTip that will make it even easier to use.
One such thing is to add a server-side Show method.
For the time being the approach taken is the right one.
Best regards,
Tervel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I want to launch a RadToolTipManager through server side. Is this possible?
The closest I have got is using a RadAjax panel example above but i get "null is null or not an object"
function
showMyToolTip() {
$find("<%=RadToolTipManager1.ClientID %>").get_tooltips()[0].show();
}
I have also tried the inject script example but that doesnt even call my javascript function.
Thanks
Mark
What i am trying to eventually achieve with this is a tooltip of validation errors. So I have radtextboxes etc which ajax back and validate. If there is a problem with the validation the error is stored in session, the codebehind then shows the tool tip manager (which is using a user control
Control
ctrl = Page.LoadControl("ToolTip.ascx");
panel.ContentTemplateContainer.Controls.Add(ctrl);
)
This user control then reads from the session and displays a lit of all validation errors on the page. I want the tooltip to scroll up and down the page as the user does. What would be nice is if i could also put a link in the user control against the error. When the user selects the link it takes the user to where the validation error is on the page.
I realise I might trying to take the control a little to far but should this be feasible.
Thanks
Your code seems fine and if you get "null" for the RadToolTipManager, I would suggest to call the function with a small timeout. If this doesn't fix the problem, please open a support ticket and send us a small sample project which isolates the behavior that you experience. We will check it and do our best to help.
Sincerely yours,
Georgi Tunev
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center