Seems like ManualClose is not working when I use "FromCode". Below is my code snippet. Any help will be greatly appreciated.
By the way, I posted here yesterday regarding the "clicked enter" issue. The issue is that my button is "being clicked" when the user hits enter, and therefore the tooltip is displayed. Basically, i'm trying to prevent the tooltip from showing up when user hits enter. I just want it to be displayed when user actually "clicks" on the button. Thats what the code below is doing. It accomplishes that except that the tooltip disappears by itself. I need it to be closed manually and not automatically. I also tried just setting a large value for the hidedelay property but that doesnt seem to work as well. please help.
<script type="text/javascript"> |
var enterPressed = false; |
//displays the tooltip, prevents it from being displayed when user hits enter |
function DisplayToolTip(tooltipClientID) |
{ |
var radToolTip1 = $find(tooltipClientID); |
if (enterPressed == false) |
{ |
radToolTip1.show(); |
} |
} |
//detect whether the enter key is pressed. |
function detectEnter(evn) |
{ |
if (window.event && window.event.keyCode == 13) |
{ |
enterPressed = true; |
} |
else if (evn && evn.keyCode == 13) |
{ |
enterPressed = true; |
} |
else |
{ |
enterPressed = false; |
} |
} |
document.onkeypress = detectEnter; |
document.onmousedown = detectEnter; |
</script> |
<asp:ImageButton ID="ImageButton1" CausesValidation="false" runat="server"/> |
<telerik:RadToolTip ID="RadToolTip1" runat="server" Skin="Default" Width="300" |
ShowEvent="FromCode" |
HideEvent="ManualClose" |
TargetControlID="ImageButton1" |
IsClientID="false" |
RelativeTo="Element" |
ShowCallout="False" |
Position="BottomRight" |
> |
</telerik:RadToolTip> on the codebehind (.cs file), i have this: ImageButton1.OnClientClick = "DisplayToolTip('" + RadToolTip1.ClientID +"')";
|