private void Window_Loaded(object sender, RoutedEventArgs e) { ComputingResourcesDataSet computingResourcesDataSet = ((ComputingResourcesDataSet)(this.FindResource("computingResourcesDataSet"))); resources.Fill(computingResourcesDataSet.Resources); CollectionViewSource resourcesViewSource = ((CollectionViewSource)(this.FindResource("resourcesViewSource"))); resourcesViewSource.View.MoveCurrentToFirst(); buildResources(); }
private void BindToDataSet() { if (this.schedulerDataSet == null) { this.schedulerDataSet = new SchedulerDataSet(); this.appointmentsAdapter.Fill(this.schedulerDataSet.Appointments); ResourcesTableAdapter resourcesAdapter = new ResourcesTableAdapter(); resourcesAdapter.Fill(this.schedulerDataSet.Resources); AppointmentsResourcesTableAdapter appointmentsResourcesAdapter = new AppointmentsResourcesTableAdapter(); appointmentsResourcesAdapter.Fill(this.schedulerDataSet.AppointmentsResources); } SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource(); dataSource.EventProvider.AppointmentFactory = this.radSchedulerDemo.AppointmentFactory; AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo(); appointmentMappingInfo.Mappings.Add(new SchedulerMapping("Email", "Email")); appointmentMappingInfo.UniqueId = "ID"; appointmentMappingInfo.Start = "Start"; appointmentMappingInfo.End = "End"; appointmentMappingInfo.Summary = "Summary"; appointmentMappingInfo.Description = "Description"; appointmentMappingInfo.Location = "Location"; appointmentMappingInfo.BackgroundId = "BackgroundID"; appointmentMappingInfo.StatusId = "StatusID"; appointmentMappingInfo.Resources = "AppointmentsAppointmentsResources"; appointmentMappingInfo.ResourceId = "ResourceID"; appointmentMappingInfo.RecurrenceRule = "RecurrenceRule"; appointmentMappingInfo.Exceptions = "AppointmentsAppointments"; appointmentMappingInfo.MasterEventId = "ParentID"; appointmentMappingInfo.Visible = "Visible"; dataSource.EventProvider.Mapping = appointmentMappingInfo; dataSource.EventProvider.DataSource = this.schedulerDataSet.Appointments; ResourceMappingInfo resourceMappingInfo = new ResourceMappingInfo(); resourceMappingInfo.Id = "ID"; resourceMappingInfo.Name = "ResourceName"; dataSource.ResourceProvider.Mapping = resourceMappingInfo; dataSource.ResourceProvider.DataSource = this.schedulerDataSet.Resources; this.radSchedulerDemo.DataSource = dataSource; }
private void BindToDataSet() { if (this.schedulerDataSet == null) { this.schedulerDataSet = new SchedulerDataset(); AppointmentsTableAdapter appointmentsAdapter = new AppointmentsTableAdapter(); appointmentsAdapter.Fill(this.schedulerDataSet.Appointments); ResourcesTableAdapter resourcesAdapter = new ResourcesTableAdapter(); resourcesAdapter.Fill(this.schedulerDataSet.Resources); TransientAppointmentsResourcesTableAdapter appointmentsResourcesAdapter = new TransientAppointmentsResourcesTableAdapter(); appointmentsResourcesAdapter.Fill(this.schedulerDataSet.TransientAppointmentsResources); } SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource(); AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo(); appointmentMappingInfo.Start = "Start"; appointmentMappingInfo.End = "End"; appointmentMappingInfo.Summary = "Summary"; appointmentMappingInfo.Description = "Description"; appointmentMappingInfo.Location = "Location"; appointmentMappingInfo.BackgroundId = "BackgroundID"; appointmentMappingInfo.StatusId = "StatusID"; appointmentMappingInfo.Resources = "Appointments_AppointmentsResources"; appointmentMappingInfo.ResourceId = "ResourceID"; appointmentMappingInfo.RecurrenceRule = "RecurrenceRule"; dataSource.EventProvider.Mapping = appointmentMappingInfo; dataSource.EventProvider.DataSource = this.schedulerDataSet.Appointments; ResourceMappingInfo resourceMappingInfo = new ResourceMappingInfo(); resourceMappingInfo.Id = "ID"; resourceMappingInfo.Name = "ResourceName"; dataSource.ResourceProvider.Mapping = resourceMappingInfo; dataSource.ResourceProvider.DataSource = this.schedulerDataSet.Resources; this.radSchedulerDemo.DataSource = dataSource; }