Hi All,
The example of ToolTip / RadToolTip for RadCalendar can display the appointment details in the tooltip. And it displays only one appointment for the day that has appointments. Now I'm working on a RadCalendar with RadToolTip and I need the ToolTip to display all events of that day.
I passed Start as parameter, my code is:
Then I got error "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
I don't know how to do with this. Please help. Thanks !
The example of ToolTip / RadToolTip for RadCalendar can display the appointment details in the tooltip. And it displays only one appointment for the day that has appointments. Now I'm working on a RadCalendar with RadToolTip and I need the ToolTip to display all events of that day.
I passed Start as parameter, my code is:
Private Function IsDayRegisteredForTooltip(ByVal [date] As DateTime) As DateTime |
Dim connectionString As String = ConfigurationManager.ConnectionStrings("eCalendarConnectionString").ConnectionString |
Dim con As New SqlConnection(connectionString) |
Dim cmd As New SqlCommand("SELECT Start FROM tblActivities WHERE convert( varchar(10), Start, 101 ) = convert( varchar(10), @Start, 101 )", con) |
cmd.Parameters.Add(New SqlParameter("@Start", [date])) |
Using con |
con.Open() |
Dim result As Object = cmd.ExecuteScalar() |
Return result |
End Using |
End Function |
Protected Sub RadCalendar1_DayRender(ByVal sender As Object, ByVal e As Telerik.Web.UI.Calendar.DayRenderEventArgs) |
Dim returnedStartDate As DateTime = IsDayRegisteredForTooltip(e.Day.[Date]) |
Dim cell As TableCell = e.Cell |
cell.Attributes.Add("onmouseover", "ShowToolTip(this);") |
cell.Attributes.Add("id", "Calendar1_" + e.Day.Date.ToString()) |
cell.Attributes.Add("startDate", returnedStartDate.ToString()) |
End Sub |
Then I got error "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."
I don't know how to do with this. Please help. Thanks !