search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

startDate vs display date on scheduler

Asked by Andy M
11 years ago.

Hello

I am wanting to use the scheduler in the resources format to

1 - show all historical, present and future info.

2 - I want the initial view the user is presented with to show 'today'.

I set the startDate to Today which satisfies requirement 2. But this then prevents historical data being scrollable (if that is a word) to! Conversely, if I set the startDate to say 'Today- 6 months' I can see the past 6 months history, but the first date the user sees is the 6 months ago one instead of today's.

Is it possible to do this? Am I missing something really obvious?

Many thanks

Andy

Comment posted by Dan Letecky
11 years ago.
There is a property ScrollPosition (DateTime) that does exactly what you want. It sets the initial scroll position to the specified date (and time). The default value is DateTime.Now so "today" should always be visible (if it's within the visible range).
Comment posted by Andy M
11 years ago.

Thanks for your quick response Dan.

I have set both properties appropriately, but the control still displays from the startDate.

Is there another field which needs to be set somewhere?

Comment posted by Dan Letecky
11 years ago.
There might be a bug somewhere. Just a check - does the online demo start at the current time (http://www.daypilot.org/demo/Scheduler/)?

Can you post the DayPilot declaration from your .aspx file?

Is it inside any container, like UpdatePanel (from ASP.NET AJAX Extensions) or TabPanel (from AJAX Control Toolkit)?
Comment posted by Andy M
11 years ago.

Hi Dan

I've done some playing around and yes, when I run the Demo, it appears at the current date, not the start date.

My code is:

<DayPilot:DayPilotScheduler ID="DayPilotScheduler1"
runat="server" Days="365" StartDate="2007-03-01"
ScrollPosition="2007-09-22"
DataStartField="startTime" DataEndField="endTime"
DataTextField="Title" DataValueField="calendar_id"
HeaderFontSize="8pt" HeaderHeight="17"
DataResourceField="eventCategory" EventHeight="40"
CellDuration="1440" CellWidth="30" CellGroupBy="Month"
TimeRangeSelectedHandling="Hold"

DataTagFields="TextColour, ToolTip"
ClientObjectName="dps1" Width="500px"
OnBeforeEventRender="DayPilotScheduler1_BeforeEventRender"
OnEventClick="DayPilotScheduler1_EventClick" EventClickHandling="PostBack"
>
<Resources>
<DayPilot:Resource Name="Short Obj" Value="1000" />
<DayPilot:Resource Name="Medium Obj" Value="1001" />
<DayPilot:Resource Name="Long Obj" Value="1002" />
<DayPilot:Resource Name="Nutrition" Value="1005" />
<DayPilot:Resource Name="Competition" Value="1004" />
<DayPilot:Resource Name="Private" Value="1006" />
<DayPilot:Resource Name="Coaches " Value="1007" />
<DayPilot:Resource Name="Training" Value="1003" />
</Resources>
</DayPilot:DayPilotScheduler>

WIthin the C# code file, the only meddling I so is:

DayPilotScheduler1.DataSource = myDataSet;
DayPilotScheduler1.DataBind();

and of course the event handling and render functions. I even tried taking out the render functionality (both in aspx and cs) and no difference made.

I don't use AJAX at all with this project.

Any ideas?

Thanks

Andy

Comment posted by Dan Letecky
11 years ago.
I will give it a try with your code.

Meanwhile, if you see any JavaScript error during initial page loading, let me know.
Comment posted by Andy M
11 years ago.

Dan

I got to the bottom of this one.

The <form> tags weren't 'formed' correctly. For some reason, the page had been set up with the form tags effectivley wrapping the table which contained the scheduler control. I moved them to 'standard' position just within the <body> tags and all works fine now.

Thanks

Andy M

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.