Dynamically adding TargetControls

2 posts, 0 answers
  1. Inge Wandsvik
    Inge Wandsvik avatar
    117 posts
    Member since:
    Sep 2006

    Posted 18 Dec 2007 Link to this post

    Hi.
    I want to add targetcontrols for a RadToolTipManager, since the ToolTip is defined in a database. How do I do this? I have tried the following:
    <code>
    <telerik:RadToolTipManager ID="RadToolTipManager1"
        runat="server"
        ManualClose="false"
        Skin="WebBlue"
        Sticky="true"
        OnAjaxUpdate="RadToolTipManager1_AjaxUpdate"
        RelativeTo="Element">
    </telerik:RadToolTipManager>
    </code>

    <code>
    'CodeBehind

    Public Sub getMyHelp       
     Dim reader As DataTableReader = somedataset.Tables(0).CreateDataReader

            While (reader.Read)
                If reader.Item("Field") = "txtClientNumber" Then
                    Dim ttClientNumber As New Label()
                    ttClientNumber.Text = reader.Item("HelpText")
                    ttClientNumber.ID = reader.Item("Field")
                    Me.RadToolTipManager1.TargetControls.Add(reader.Item("Field"), True)
                End If
     End While
    End Sub


    </code>
  2. Inge Wandsvik
    Inge Wandsvik avatar
    117 posts
    Member since:
    Sep 2006

    Posted 18 Dec 2007 Link to this post

    Never mind. I found out how:
    <code>
    If reader.Item("Field") = "txtClientNumber" Then
        Me.txtClientNumber.ToolTip = reader.Item("HelpText")
        Me.RadToolTipManager1.TargetControls.Add(reader.Item("Field"))
    End If
    </code>
Back to Top