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

RadTextBox doesn't update after 1st tooltip opening

3 Answers 121 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
TwoLaJit
Top achievements
Rank 2
TwoLaJit asked on 10 Jul 2009, 06:49 AM

I am using RadTooltipManager with ShowEvent = OnClick.
I dynamically add my user control in the OnAjaxUpdate method and then call a sub to load the data within the user control.

everything loads fine the 1st time I open the tooltip.
From within the user control i pull data from the database and populate a few radtextboxes.
then when I close the tooltip and open it again and my LoadData method is called again, the .text property on the radtextbox doesn't update. it still shows the value from the 1st time the .text property was set.

Stepping through my code I am positive that the property is getting set to the correct value.
After stepping into the line of code that sets the .text property, i verify that the property is set correctly.
Yet when the control renders, it still has the original value.

Here's the funny part. If I set the value to a label rather than a textbox, it works as expected.
It's only textboxes where the new value does not get set. I tried it with a RadTextBox and a normal TextBox and neither works correctly.
Also tried it with a RadComboBox - same as textbox, doesn't work.

Any ideas? This is driving me crazy.

3 Answers, 1 is accepted

Sort by
0
Accepted
Svetlina Anati
Telerik team
answered on 10 Jul 2009, 08:45 AM

Hi TwoLaJit,

When we add to the tooltip controls with ViewState we have to make sure that these controls are created before the LoadViewState event fires so that their ViewState information is loaded. In order to avoid forcing our clients to recreate all their controls in the Init event on postback, we decided to fire the AjaxUpdate event earlier in the page lifecycle. That is why the textboxes and other viewstate controls in your case  take its old data from the ViewState and does not get updated.

In order to get the desired result, you should set the new value in the User control's 's PrePender event, this should do the trick.

Greetings,

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.
0
TwoLaJit
Top achievements
Rank 2
answered on 11 Jul 2009, 08:27 PM
Thanks for the reply. I am currently passing a value to the usercontrol and am loading the user control dynamically in the OnAjaxUpdate method.

How can I pass this value to the usercontrol so that I can access that value in the PreRender method?

Thanks,
0
TwoLaJit
Top achievements
Rank 2
answered on 11 Jul 2009, 08:39 PM
I think I have answered my own question.
I created 2 properties in the UserControl, then set the values before adding the control to the tooltip UpdatePanel.


Dim ctrl As ButtonConfig = Page.LoadControl("ButtonConfig.ascx")  
        ctrl.ButtonNo = args.Value  
        ctrl.RegisterNo = Request.QueryString("RegisterNo")  
        args.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl) 
Tags
ToolTip
Asked by
TwoLaJit
Top achievements
Rank 2
Answers by
Svetlina Anati
Telerik team
TwoLaJit
Top achievements
Rank 2
Share this question
or