Hi
I have a RadScheduler set in timeline mode and I need to display a period of 3 days before and 30 behind a certain date.
When I select the date on the date picker the actual selected date of the timeline has to be SelectedDate.AddDays(-3).
I tried this:
the SelectedDate of the popupCalendar is the same as the SelectedDate of the timeline and not the date I selected on the page.
After the date is selected in the calendar picker the page does a postback so I tried grabbing the PreRender event of the timeline and see if there is the date that i selected somewhere in the event args but no luck.
How can I find this date, currently if I select a date from the calendar no date is changed so maybe it is my fault so here is my timeline definition
Thank you
I have a RadScheduler set in timeline mode and I need to display a period of 3 days before and 30 behind a certain date.
When I select the date on the date picker the actual selected date of the timeline has to be SelectedDate.AddDays(-3).
I tried this:
protected
void
dispTimeline_NavigationCommand(
object
sender, Telerik.Web.UI.SchedulerNavigationCommandEventArgs e)
{
switch
(e.Command)
{
case
Telerik.Web.UI.SchedulerNavigationCommand.NavigateToPreviousPeriod:
dispTimeline.SelectedDate = dispTimeline.SelectedDate.AddDays(-1);
e.Cancel =
true
;
break
;
case
Telerik.Web.UI.SchedulerNavigationCommand.NavigateToNextPeriod:
dispTimeline.SelectedDate = dispTimeline.SelectedDate.AddDays(1);
e.Cancel =
true
;
break
;
case
SchedulerNavigationCommand.SwitchToSelectedDay:
dispTimeline.SelectedDate = e.SelectedDate.AddDays(-3);
e.Cancel =
true
;
break
;
case
SchedulerNavigationCommand.NavigateToSelectedDate:
RadCalendar popupCalendar = dispTimeline.FindControl(
"SelectedDateCalendar"
)
as
RadCalendar;
dispTimeline.SelectedDate = popupCalendar.SelectedDate.AddDays(-3);
// this doesn't work either
//dispTimeline.SelectedDate = popupCalendar.FocusedDate;
e.Cancel =
true
;
break
;
}
}
the SelectedDate of the popupCalendar is the same as the SelectedDate of the timeline and not the date I selected on the page.
After the date is selected in the calendar picker the page does a postback so I tried grabbing the PreRender event of the timeline and see if there is the date that i selected somewhere in the event args but no luck.
How can I find this date, currently if I select a date from the calendar no date is changed so maybe it is my fault so here is my timeline definition
<
telerik:RadScheduler
ID
=
"dispTimeline"
runat
=
"server"
DataDescriptionField
=
"Observations"
DataEndField
=
"ToDate"
DataKeyField
=
"ReservationID"
DataSourceID
=
"SqlDataSource1"
DataStartField
=
"FromDate"
DataSubjectField
=
"Description"
DayEndTime
=
"23:59:00"
DayStartTime
=
"00:00:00"
EnableDescriptionField
=
"True"
FirstDayOfWeek
=
"Monday"
HoursPanelTimeFormat
=
"H:mm"
LastDayOfWeek
=
"Sunday"
SelectedView
=
"TimelineView"
TimeLabelRowSpan
=
"1"
TimeZoneID
=
"GTB Standard Time"
TimeZoneOffset
=
"02:00:00"
WorkDayEndTime
=
"18:00:00"
WorkDayStartTime
=
"09:00:00"
MinimumInlineFormHeight
=
"200"
OverflowBehavior
=
"Expand"
Localization-HeaderMultiDay
=
"Work Week"
ColumnWidth
=
"50px"
ShowViewTabs
=
"False"
OnNavigationCommand
=
"dispTimeline_NavigationCommand"
AllowDelete
=
"False"
AllowEdit
=
"False"
AllowInsert
=
"False"
OnAppointmentClick
=
"dispTimeline_AppointmentClick"
GroupingDirection
=
"Vertical"
OnDataBound
=
"dispTimeline_DataBound"
OnNavigationComplete
=
"dispTimeline_NavigationComplete"
SelectedDate
=
"2012-10-01"
OnPreRender
=
"dispTimeline_PreRender"
>
<
AdvancedForm
Modal
=
"true"
Enabled
=
"False"
/>
<
ResourceTypes
>
<
telerik:ResourceType
Name
=
"grpTimeline"
DataSourceID
=
"dsGrup"
KeyField
=
"ID"
TextField
=
"Denumire"
ForeignKeyField
=
""
/>
<
telerik:ResourceType
KeyField
=
"StatusID"
Name
=
"Status"
TextField
=
"Description"
ForeignKeyField
=
"StatusID"
DataSourceID
=
"dsStatus"
/>
</
ResourceTypes
>
<
ResourceStyles
>
<
telerik:ResourceStyleMapping
Type
=
"Status"
Text
=
"Rezervare"
ApplyCssClass
=
"rsCategoryGreen"
/>
<
telerik:ResourceStyleMapping
Type
=
"Status"
Text
=
"Contract in derulare"
ApplyCssClass
=
"rsCategoryRed"
/>
<
telerik:ResourceStyleMapping
Type
=
"Status"
Text
=
"Contract inchis"
ApplyCssClass
=
"rsCategoryBlue"
/>
<
telerik:ResourceStyleMapping
Type
=
"Status"
Text
=
"Contract facturat"
ApplyCssClass
=
"rsCategoryDarkBlue"
/>
<
telerik:ResourceStyleMapping
Type
=
"Status"
Text
=
"Alte rezervari"
ApplyCssClass
=
"rsCategoryYellow"
/>
<
telerik:ResourceStyleMapping
Type
=
"Status"
Text
=
"Indisponibil"
BackColor
=
"DarkGray"
/>
</
ResourceStyles
>
<
Localization
HeaderMultiDay
=
"Work Week"
></
Localization
>
<
TimelineView
HeaderDateFormat
=
"dd.MMM.yyyy"
NumberOfSlots
=
"35"
SlotDuration
=
"1.00:00:00"
UserSelectable
=
"true"
SortingMode
=
"Global"
ColumnHeaderDateFormat
=
"dd.MMM"
/>
<
MultiDayView
UserSelectable
=
"false"
/>
<
DayView
UserSelectable
=
"false"
/>
<
WeekView
UserSelectable
=
"false"
/>
<
MonthView
UserSelectable
=
"false"
/>
</
telerik:RadScheduler
>
Thank you