Example E4287
Visible to All Users

WinForms Scheduler - A sample application with the Range Control

This example demonstrates main features of the WinForms Scheduler control. The Scheduler control is bound to a Microsoft SQL database and "linked" to the WinForms Range Control.

WinForms Scheduler - A sample application with the Range Control

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

Example Code

SampleSchedulerRangeControl/Form1.cs
C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using DevExpress.XtraBars; using DevExpress.XtraBars.Ribbon; using DevExpress.XtraBars.Helpers; using DevExpress.Skins; using DevExpress.LookAndFeel; using DevExpress.UserSkins; namespace SampleSchedulerRangeControl { public partial class Form1 : RibbonForm { public Form1() { InitializeComponent(); InitSkinGallery(); schedulerControl.Start = System.DateTime.Now; schedulerStorage.AppointmentsChanged += new DevExpress.XtraScheduler.PersistentObjectsEventHandler(schedulerStorage_AppointmentsChanged); schedulerStorage.AppointmentsInserted += new DevExpress.XtraScheduler.PersistentObjectsEventHandler(schedulerStorage_AppointmentsInserted); schedulerStorage.AppointmentsDeleted += new DevExpress.XtraScheduler.PersistentObjectsEventHandler(schedulerStorage_AppointmentsDeleted); schedulerStorage.Appointments.CommitIdToDataSource = false; schedulerControl.Start = new DateTime(2012,10,31); } void InitSkinGallery() { SkinHelper.InitSkinGallery(rgbiSkins, true); } private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'carsDBDataSet.Cars' table. You can move, or remove it, as needed. this.carsTableAdapter.Fill(this.carsDBDataSet.Cars); // TODO: This line of code loads data into the 'carsDBDataSet.CarScheduling' table. You can move, or remove it, as needed. this.carSchedulingTableAdapter.Fill(this.carsDBDataSet.CarScheduling); } void schedulerStorage_AppointmentsDeleted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e) { Commit(); } void schedulerStorage_AppointmentsInserted(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e) { Commit(); } void schedulerStorage_AppointmentsChanged(object sender, DevExpress.XtraScheduler.PersistentObjectsEventArgs e) { Commit(); } private void Commit() { carSchedulingTableAdapter.Update(carsDBDataSet); carsDBDataSet.AcceptChanges(); } } }

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.