
#Net scheduler update#
When the user finishes the drag and drop move operation, the scheduler will fire EventMove event handler on the server side. We will update the database to actually move the event and send an updated event set back to the client.Ĭ# protected void DayPilotScheduler1_EventMove(object sender, .Events.EventMoveEventArgs e) SqlDataAdapter da = new SqlDataAdapter("SELECT, FROM ", ) ĭ(name, id) ĭim da As New SqlDataAdapter("SELECT, FROM ", ConfigurationManager.ConnectionStrings("DayPilot").ConnectionString)ĭim name As String = DirectCast(r("name"), String)ĭim id_Renamed As String = Convert.ToString(r("id"))ĭ(name, id_Renamed)Įnd Sub Drag and Drop Scheduler Event Moving In the Page_Load method, we call LoadResources() method that loads the resources using DayPilotScheduler.Resources collection. VB.NET Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)ĭayPilotScheduler1.StartDate = New Date(, 1, 1)ĭayPilotScheduler1.Days = Year.Days()ĭayPilotScheduler1.DataSource = DbGetEvents(DayPilotScheduler1.StartDate, DayPilotScheduler1.Days)ĭayPilotScheduler1.SetScrollX(Date.Today)

Set the initial scrollbar position to today.Ĭ# protected void Page_Load(object sender, EventArgs e)ĭayPilotScheduler1.StartDate = new DateTime(, 1, 1) ĭayPilotScheduler1.Days = Year.Days() ĭayPilotScheduler1.DataSource = DbGetEvents(DayPilotScheduler1.StartDate, DayPilotScheduler1.Days) ĭayPilotScheduler1.SetScrollX(DateTime.Today) Set the grid start date to the first day of the current year. Load the resources (vertical axis) from the database. The code behind file ( or ) will contain two event handlers: The following attributes specify the time scale:ĬellGroupBy - unit of the first column header row ( Year | Month | Week | Day | Hour | None )ĮventMoveHandling - enables event moving (the action will be handled by an AJAX callback)įor the C# project we also define the EventMove event handler here (in VB.NET it's defined using Handles clause in the ): Read more about scheduler event loading . The following attributes are required by DayPilot:ĭataStartField - specifies the data source column that contains event start (DateTime)ĭataEndField - specifies the data source column that contains event end (DateTime)ĭataTextField - specifies the data soruce column that contains event text (string)ĭataIdField - specifies the data source column that contains event id (string or integer)ĭataResourceField - specifies the data soruce column that contains event resource foreign key (string) The following attributes are required by ASP.NET: You can add DayPilot controls to the Visual Studio Toolbox:Ĭreate a new web site in Visual Studio or Visual Web Developer.Ĭreate a Bin directory in the web site and copy DayPilot.dll there.Īdd a new page to the site (Default.aspx).Īdd the following line to Default.aspx, right below line: Ĭopy the following snippet to the page (inside element):

#Net scheduler pro#
You can use the source code of the tutorial if you are a licensed user of DayPilot Pro for ASP.NET WebForms.

Licensed for testing and evaluation purposes. Year view (365 days), day scale (1 cell = 1 day), grouped by month This is a beginner tutorial that shows the basic features:
#Net scheduler how to#
This tutorial shows how to use DayPilot ASP.NET scheduler in a web application.
