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

RadToolTip/Multiple UserControl

4 Answers 178 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Andrew Thompson
Top achievements
Rank 1
Andrew Thompson asked on 23 Jan 2008, 10:10 PM
My goal: create a TextBox that is readonly. Click on the text, and a ToolTip appears where you can 'edit' the content and click on save where upon the tooltip disappears and the form is updated.

I created the user control and in the Tooltip attributes set the TargetControlID to the Textbox (ID=PayLoadTextBox) and set the IsClientID to false.

It works great.

Now I want to be able to add multiple of these controls onto a single page. I therefore change the TargetControlID to "<%= PayLoadTextBox.ClientID %>" and set the IsClientID to true.

Now the popup doesn't appear. (Nothing else was changed.)

Am I missing something obvious?


Thanks,


Andrew T.

4 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 24 Jan 2008, 01:32 PM
Hello Andrew Thompson,
Unfortunately in this case the code between the '<%= %>' tags is not resolved to the ClientID of the textbox, but is taken as it is. That is why, in order to get the desired result, you can use one of the following approaches:
  1. Set the TargetControlID of the RadToolTip in the code-behind:
    protected void Page_Load(object sender, EventArgs e)  
    {  
        this.RadToolTip1.TargetControlID = this.PayLoadTextBox.ClientID;  
  2. Use databinding expressions (in this case you will have to call DataBind for the RadToolTip):
    <telerik:RadToolTip ID="RadToolTip1" runat="server"   
    TargetControlID="<%# PayLoadTextBox.ClientID %>" IsClientID="true"></telerik:RadToolTip> 
    protected void Page_Load(object sender, EventArgs e)  
    {  
        this.RadToolTip1.DataBind();  
Regards,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Andrew Thompson
Top achievements
Rank 1
answered on 24 Jan 2008, 03:04 PM
The first technique doesn't work with 2.0 Framework because ClientID is a readonly property, however the second technique worked like a charm.

Thank you very much for your prompt response.
0
Tervel
Telerik team
answered on 24 Jan 2008, 03:13 PM
Hello Andrew,

The first approach will definitely work as well - it is not the ClientID that is being assigned to, but the TargetControlID property. The ClientID is simply being "read", not "written to".

this.RadToolTip1.TargetControlID   = this.PayLoadTextBox.ClientID;

We are glad to know that you got things working though.

Best regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Andrew Thompson
Top achievements
Rank 1
answered on 24 Jan 2008, 03:35 PM
You are perfectly correct, my bad.

I've got too much coffee and not enough braincells this morning.

Thank you.
Tags
ToolTip
Asked by
Andrew Thompson
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Andrew Thompson
Top achievements
Rank 1
Tervel
Telerik team
Share this question
or