I would like to either redirect the page or open a new window on user selection of new appointment by double clicking on the scheduler. I have been able to do it with editing/viewing an appointment but not for new appointments. Any solutions for this issue?
<
telerik:RadScheduler
ID
=
"rsRooms"
runat
=
"server"
DataStartField
=
"dtStartDateTime"
DataEndField
=
"dtEndDateTime"
DataKeyField
=
"intRequestId"
DataSubjectField
=
"Title"
OverflowBehavior
=
"Expand"
SelectedView
=
"WeekView"
MonthView-VisibleAppointmentsPerDay
=
"6"
MultiDayView-UserSelectable
=
"False"
TimelineView-UserSelectable
=
"False"
Skin
=
"Office2010Blue"
Width
=
"100%"
WeekView-DayStartTime
=
"07:00:00"
WeekView-DayEndTime
=
"16:59:59"
WorkDayStartTime
=
"07:00:00"
WorkDayEndTime
=
"16:00:00"
DayView-DayEndTime
=
"16:00:00"
DayView-DayStartTime
=
"07:00:00"
CustomAttributeNames
=
"intRoomScheduledId"
>
</
telerik:RadScheduler
>
Private Sub loadCal()
Dim roomId As Integer = Convert.ToInt32(ddlRooms.SelectedValue)
sql = String.Format("SELECT DISTINCT(r.intRequestId), s.intRoomScheduledId, s.dtMeetingDate dtStartDateTime, CONVERT(VARCHAR(10),s.dtMeetingDate, 120) + ' ' + " _
& "SUBSTRING(CONVERT(VARCHAR(23),r.dtEndDateTime,121),11,20) dtEndDateTime, r.strRemarks, ISNULL(p.strPurpose, r.strPurpose) + ': ' + " _
& "REPLACE(CONVERT(VARCHAR(5),r.dtStartDateTime,108),':','') + '-' + REPLACE(CONVERT(VARCHAR(5),r.dtEndDateTime,108),':','') Title " _
& "FROM tblRequest r JOIN tblRoomScheduled s ON s.intRequestId = r.intRequestId LEFT JOIN tblPurpose p ON r.intPurposeId = p.intPurposeId " _
& "WHERE s.intRoomId = {0}", roomId)
rsRooms.DataSource = getData(sql)
rsRooms.DataBind()
For Each apt As Telerik.Web.UI.Appointment In rsRooms.Appointments
sql = String.Format("SELECT s.intRoomScheduledId FROM tblRoomScheduled s JOIN MnNgPersonnel.dbo.tblMNNatPersonnel p ON s.intPersonnelId = p.intPersonnelId " _
& "WHERE s.intRoomScheduledId = {0} AND p.strFTLogon = '{1}'", apt.Attributes("intRoomScheduledId"), myLogon)
myDataTable = New DataTable
myDataTable = getData(sql)
If myDataTable.Rows.Count = 0 Then apt.AllowDelete = False Else apt.AllowDelete = True
Next
End Sub
Protected Sub rsRooms_AppointmentDataBound(sender As Object, e As Telerik.Web.UI.SchedulerEventArgs) Handles rsRooms.AppointmentDataBound
Dim dt As DataTable
Dim id As Integer = e.Appointment.Attributes("intRoomScheduledId")
sql = "SELECT intStatusId FROM tblRoomScheduled WHERE intRoomScheduledId = " & id
dt = New DataTable
dt = getData(sql)
If dt.Rows(0)(0) = "1" Then ' Pending
e.Appointment.BackColor = Drawing.Color.Khaki
ElseIf dt.Rows(0)(0) = "2" Then ' Approved
e.Appointment.BackColor = Drawing.Color.LightGreen
ElseIf dt.Rows(0)(0) = "3" Then ' Cancelled
e.Appointment.BackColor = Drawing.Color.DarkSalmon
e.Appointment.AllowDelete = False
End If
End Sub
Protected Sub rsRooms_AppointmentClick(sender As Object, e As Telerik.Web.UI.SchedulerEventArgs) Handles rsRooms.AppointmentClick
Dim aptId As Integer = 0
Dim reqId As Integer = 0
Dim isVTC As Boolean = False
mvRequest.ActiveViewIndex = 1
pnlSelectVTS.Visible = False
pnlRequest.Visible = False
aptId = e.Appointment.ID
hfAptId.Value = aptId
reqId = e.Appointment.Attributes("intRoomScheduledId")
sql = "SELECT bitVTC FROM tblRequest WHERE intRequestId = " & aptId
isVTC = getData(sql).Rows(0)(0)
If isVTC = True Then
sql = "SELECT intRoomScheduledId FROM tblRoomScheduled WHERE intRequestId = " & aptId
myDataTable = New DataTable
myDataTable = getData(sql)
If myDataTable.Rows.Count > 1 Then rblVTC.SelectedValue = "1" Else rblVTC.SelectedValue = "0"
Else
rblVTC.SelectedValue = "2"
End If
Dim strURL As String = String.Format("RequestDetails.aspx?apt={0}&rm={1}&dt={2}", encryptQueryString(reqId), encryptQueryString(ddlRooms.SelectedValue), encryptQueryString(e.Appointment.Start))
Page.ClientScript.RegisterStartupScript(Me.GetType(), "New Window", "window.open('" + strURL + "','','')", True)
End Sub