Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            schedulerControl1.Start = new System.DateTime(2010, 7, 15, 0, 0, 0, 0);

            this.dataSet = new CarsDBDataSet();

            // Bind Scheduler storage to appointment data
            this.schedulerControl1.Storage.AppointmentStorage.DataSource = dataSet.CarScheduling;

            // Load data into the 'CarsDBDataSet.CarScheduling' table.
            this.adapter = new CarsDBDataSetTableAdapters.CarSchedulingTableAdapter();
            this.adapter.Fill(dataSet.CarScheduling);

            // Bind Scheduler storage to resource data
            this.schedulerControl1.Storage.ResourceStorage.DataSource = dataSet.Cars;

            // Load data into the 'CarsDBDataSet.Cars' table.
            CarsDBDataSetTableAdapters.CarsTableAdapter carsAdapter =
                new CarsDBDataSetTableAdapters.CarsTableAdapter();
            carsAdapter.Fill(dataSet.Cars);

            this.schedulerControl1.Storage.AppointmentsInserted +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);
            this.schedulerControl1.Storage.AppointmentsChanged +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);
            this.schedulerControl1.Storage.AppointmentsDeleted +=
                new PersistentObjectsEventHandler(Storage_AppointmentsModified);

            this.adapter.Adapter.RowUpdated +=
                new System.Data.OleDb.OleDbRowUpdatedEventHandler(adapter_RowUpdated);
        }
        public MainWindow()
        {
            InitializeComponent();

            // Bind the scheduler to data.
            CarsDBDataSet dataSet = new CarsDBDataSet();

            scheduler.Storage.AppointmentStorage.DataSource = dataSet.CarScheduling;
            CarsDBDataSetTableAdapters.CarSchedulingTableAdapter tableAdapter =
                new CarsDBDataSetTableAdapters.CarSchedulingTableAdapter();
            tableAdapter.Fill(dataSet.CarScheduling);

            scheduler.Storage.ResourceStorage.DataSource = dataSet.Cars;
            CarsDBDataSetTableAdapters.CarsTableAdapter carsAdapter =
                new CarsDBDataSetTableAdapters.CarsTableAdapter();
            carsAdapter.Fill(dataSet.Cars);

            // Set the scheduler start date.
            scheduler.Start = new System.DateTime(2010, 7, 15, 0, 0, 0, 0);

            // Specify the time inteval and start day of week used by the print adapter to create a report.
            printAdapter.TimeInterval =
                new TimeInterval(new DateTime(2010, 7, 15), new DateTime(2010, 7, 30));
            printAdapter.FirstDayOfWeek = FirstDayOfWeek.Wednesday;

            // Specify required printing settings to be passed
            // to the SchedulerPrintHelper.ShowPrintPreview method that is called on a button click.
            printingSettings.ReportInstance        = new XtraSchedulerReport();
            printingSettings.SchedulerPrintAdapter = printAdapter;
            printingSettings.ReportTemplatePath    = "WeeklyStyle.schrepx";
        }