issue in displaying tooltip

4 posts, 0 answers
  1. Praveen
    Praveen avatar
    11 posts
    Member since:
    Jan 2011

    Posted 25 Jan 2011 Link to this post

    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.

     

     

  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 27 Jan 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Praveen
    Praveen avatar
    11 posts
    Member since:
    Jan 2011

    Posted 28 Jan 2011 Link to this post

    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.
  5. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 01 Feb 2011 Link to this post

    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.
Back to Top