B
Bryan
Hello,
I am taking values from a datatable and formatting them for use in a
JavaScript Function Call.
The end result is a mouse over tool tip.
Here is what I am doing.
I have tried to use a property but it uses the last set value of all.
Private Sub drTasks_ItemDataBound(ByVal sender As Object,
ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs)
Handles
drTasks.ItemDataBound
If e.Item.ItemType = ListItemType.Item Then
Dim ttTitle As String = IIf(Not IsDBNull(e.Item.DataItem("Title")),
e.Item.DataItem("Title"), "")
Dim ttDesc As String = IIf(Not
IsDBNull(e.Item.DataItem("Description")), e.Item.DataItem("Description"),
"")
Dim ttDateStart As String = IIf(Not
IsDBNull(e.Item.DataItem("DateStart")),
CDate(e.Item.DataItem("DateStart")).ToShortDateString, "")
Dim ttDateDue As String = IIf(Not
IsDBNull(e.Item.DataItem("DateDue")),
CDate(e.Item.DataItem("DateDue")).ToShortDateString, "")
Dim ToolTip As New System.Text.StringBuilder
' First I build the text
ToolTip.Append("Title: " & ttTitle & "<br /><br />")
If ttDesc <> "" Then ToolTip.Append(ttDesc & "<br /><br />")
ToolTip.Append("Start Date: " & ttDateStart & "<br />Due Date: " &
ttDateDue)
' Once I have finished I push the value into the description.
e.Item.DataItem("Description") = ToolTip
End If
End Sub
On the HTML side I use the following in the <ItemTemplate> of the Repeater
Control.
...<td.... onMouseover="ddrivetip('<%#DataBinder.Eval(Container,
"DataItem.Description")%>','#284461', 300)">...
Any Iteas?
Thanks,
Bryan
I am taking values from a datatable and formatting them for use in a
JavaScript Function Call.
The end result is a mouse over tool tip.
Here is what I am doing.
I have tried to use a property but it uses the last set value of all.
Private Sub drTasks_ItemDataBound(ByVal sender As Object,
ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs)
Handles
drTasks.ItemDataBound
If e.Item.ItemType = ListItemType.Item Then
Dim ttTitle As String = IIf(Not IsDBNull(e.Item.DataItem("Title")),
e.Item.DataItem("Title"), "")
Dim ttDesc As String = IIf(Not
IsDBNull(e.Item.DataItem("Description")), e.Item.DataItem("Description"),
"")
Dim ttDateStart As String = IIf(Not
IsDBNull(e.Item.DataItem("DateStart")),
CDate(e.Item.DataItem("DateStart")).ToShortDateString, "")
Dim ttDateDue As String = IIf(Not
IsDBNull(e.Item.DataItem("DateDue")),
CDate(e.Item.DataItem("DateDue")).ToShortDateString, "")
Dim ToolTip As New System.Text.StringBuilder
' First I build the text
ToolTip.Append("Title: " & ttTitle & "<br /><br />")
If ttDesc <> "" Then ToolTip.Append(ttDesc & "<br /><br />")
ToolTip.Append("Start Date: " & ttDateStart & "<br />Due Date: " &
ttDateDue)
' Once I have finished I push the value into the description.
e.Item.DataItem("Description") = ToolTip
End If
End Sub
On the HTML side I use the following in the <ItemTemplate> of the Repeater
Control.
...<td.... onMouseover="ddrivetip('<%#DataBinder.Eval(Container,
"DataItem.Description")%>','#284461', 300)">...
Any Iteas?
Thanks,
Bryan