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

Radtooltip text edit

1 Answer 89 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Meghna
Top achievements
Rank 1
Meghna asked on 16 Jul 2009, 02:43 PM
In my page i have placed one textbox, one label,three buttons.
When i click on one image button the radtooltip gets appear. On that i have shown the tooltip text in label and one edit button.
To edit the text inside the tooltip, i have functionality to click on the edit button. And with this edit click i am replacing label with text box and edit buttons with the save and cancel button.

My problem is whenever i click edit button postback occurs and it removes the tooltip from the page and then when i click again on the image button for tooltip i see only text box and two button of save and cancel.

My requirement is like, if i click on edit button i don't want a page to get refresh. And as soon as i click on edit button the textbox will be appeared and save and cancel button.

Can any one help me? It would be great if you can provide any sample application for this.

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 17 Jul 2009, 12:17 PM

Hello Meghna,

When you perform a postback, the RadToolTip's client-object is destroyed and a new one is created when the page loads again after the postback. That is why you should again show the tooltip in case it does not have VisibleOnPageLoad set to true and this is the expected behavior.

I suggest to use one of the following approaches to get the desired result:

1. Wrap the RadToolTip's content in a RadAjaxPanel or a standard asp update panel - in this case only the content will be updated and the tooltip itself will not be destroyed and will stay open. By using this ajax approach, you will also take advantage of AJAX and will avoid the flicker which the postback causes. If you choose this approach, your code should look similar to the following one:

 <telerik:RadToolTip ID="RadToolTip1" runat="server" OffsetY="20" OffsetX="20" TargetControlID="CheckBox1" 
        Position="BottomCenter" ShowEvent="FromCode" Animation="Fade" HideEvent="FromCode" 
        Visible="true" Height="200" Width="300" Modal="True">  
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">   

content here - button, label, etc        


        </telerik:RadAjaxPanel> 
    </telerik:RadToolTip> 

2 When you perform a postback you can pass a flag parameter to the server and then read it on the client to determine whether to show the tooltip again. If the tooltip should show, you should call its method show() in pageLoad and in this manner the tooltip will be visible again after the postback.

It is up to you to decide which approach to use but in my opinion the first one is the better one since it is much easier to implement and you will get additional benefits from AJAX.

Best wishes,

Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ToolTip
Asked by
Meghna
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or