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

issue in displaying tooltip

3 Answers 90 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Praveen
Top achievements
Rank 1
Praveen asked on 25 Jan 2011, 07:53 AM

Hi,

I am creating controls dynamically target control as well as telerik tooltip control using client side code as below (first creating table and tr and then td, in one of td creating the cotrols as below)

 

Dim

 

 

html As New StringBuilder()

 

 

 

 

html.Append(

 

"<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"" bgcolor=""#978F80"">")

 

 

 

 

html.Append(

 

"<tr bgcolor=""lightblue"" style=""font:bold 11px Arial, Helvetica, sans-serif; color:#000000; text-align:center"">")

 

 

 

 

html.Append(

 

 

 

"<td width=""15%"" style=""border-bottom:3px solid #ffffff;"" >")

 

 

 

 

html.Append("<asp:Label ID=""" & lblName & intLblCounter.ToString.Trim & """ Text=""test"" Width=""100%"" runat=""server"" ToolTip="" Out Time   : " & getTimeAsString(dtBreaks.Rows(i - temp)(1).ToString) & " <br/> In Time    :" & getTimeAsString(dtBreaks.Rows(i - temp)(0).ToString) & " <br/> Break Time :" & "00:01:00" & """ ></asp:Label>")

 

html.Append("<telerik:RadToolTip ID=""" & tooltiplbl & intLblCounter.ToString.Trim & """ Text="" Out Time   : " & getTimeAsString(dtBreaks.Rows(i - temp)(1).ToString) & " <br/> In Time    :" & getTimeAsString(dtBreaks.Rows(i - temp)(0).ToString) & " <br/> Break Time :" & "00:01:00" & """ TargetControlID =""" & lblName & intLblCounter.ToString.Trim & """ runat=""server""/>")

 

html.Append(

 

"</td>")
html.Append("</tr>")
html.Append(
"</table>")

 

 

 

But not getting the tooltip is and when I copy the client side code while debugging and pasting another page, executing the page able to see the tooltip and when I am  creating the controls runtime then unable to see the tooltip.

Could you please suggest/help me on this?

Thanks,
Praveen Kumar palla.

 

 

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 27 Jan 2011, 02:38 PM
Hello Praveen,

 The problem comes from the fact that the code you have used is incorrect and it cannot initialize a control - its just markup declaratios as a string.

To dynamically create a RadToolTip in code-behind you should do this in the following manner:


Dim tt As New RadToolTip()
tt.ID = "ToolTipID"
tt.TargetControlID = target.ID

.....................................


Me.form1.Controls.Add(tt)

Regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Praveen
Top achievements
Rank 1
answered on 28 Jan 2011, 07:43 AM
Thanks for the responce

And My requirement is need to create the html table dynamically (since how many tr or td tags required will be known at runtimje) in one of td need place lable or other control and on mouseover on the control tooltip should come. Using stringbuilder  I am creating html tags to create table and tr and td but place controls in required td...

Could you/anyone please suggest me how can I do this?

Thanks,
Praveen Kumar Palla.
0
Svetlina Anati
Telerik team
answered on 01 Feb 2011, 10:42 AM
Hello Praveen,

 You cannot initiate complex server controls in the manner you have used. What I suggest is to use the Table, TableRow, etc classes which are built - in in the Framework especially for creating an HTML table from the server - please examine the articles below;

http://msdn.microsoft.com/en-us/library/ty0ce8sc.aspx
http://msdn.microsoft.com/en-us/library/7bewx260.aspx

Once you have created the table you can add any desired control to any cell by adding it to its Controls collection.

Greetings,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ToolTip
Asked by
Praveen
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Praveen
Top achievements
Rank 1
Share this question
or