I am trying to add the radtooltip into an item template of a dynamically created table. I have the follwing code
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn |
gridLabel = New Label() |
AddHandler gridLabel.DataBinding, AddressOf gridLabel_DataBinding |
gridCheck = New CheckBox() |
AddHandler gridCheck.DataBinding, AddressOf GridCheck_DataBinding |
gridCheck.Enabled = True |
container.Controls.Add(gridCheck) |
container.Controls.Add(gridLabel) |
End Sub |
Sub GridCheck_DataBinding(ByVal sender As Object, ByVal e As EventArgs) |
Dim cBox As CheckBox = DirectCast(sender, CheckBox) |
Dim container As GridDataItem = DirectCast(cBox.NamingContainer, GridDataItem) |
If DirectCast(container.DataItem, DataRowView)("ContractObjectiveID").ToString <> "0" Then |
cBox.Checked = True |
Else |
cBox.Checked = False |
End If |
End Sub |
Public Sub gridLabel_DataBinding(ByVal sender As Object, ByVal e As EventArgs) |
Dim l As Label = DirectCast(sender, Label) |
Dim container As GridDataItem = DirectCast(l.NamingContainer, GridDataItem) |
l.ID = "Label1" |
l.Text = (DirectCast(container.DataItem, DataRowView))("ObjectiveCode").ToString() |
Dim t As Telerik.Web.UI.RadToolTip = New Telerik.Web.UI.RadToolTip |
t.Text = (DirectCast(container.DataItem, DataRowView))("Description").ToString() |
t.Position = ToolTipPosition.MiddleRight |
t.RelativeTo = ToolTipRelativeDisplay.Element |
t.TargetControlID = l.ID |
End Sub |
I do not get an error but at the same time I don not get the tooltip to show. I need to be able to change the grid based on a field in the database. I have the grid created but need to add the tooltip. Is this possible?