hello, I need your help
I am working in lightswicht and I want to use the control ScheduleView.
I created the table ScheduleViewAppts and one screen where I used the control.
I want to add relationships to the table and edit this new fiels in the AppointmentEdit window: the fields are Serviçe and Local.
In my RadScheduleViewControl.xaml I have:
<UserControl x:Class="LightSwitchApplication.RadScheduleViewControl" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns:schedule="clr-namespace:Telerik.Windows.Controls.ScheduleView;assembly=Telerik.Windows.Controls.ScheduleView" xmlns:scheduleView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"> <Grid x:Name="LayoutRoot" Background="White" > <telerik:RadScheduleView x:Name="xScheduleView" AppointmentCreated="xScheduleView_AppointmentCreated" AppointmentDeleted="xScheduleView_AppointmentDeleted" AppointmentEdited="xScheduleView_AppointmentEdited" > <telerik:RadScheduleView.ViewDefinitions> <telerik:DayViewDefinition Title="Dia" FirstDayOfWeek="Sunday" DayStartTime="07:00" DayEndTime="20:00" CalendarWeekRule="FirstFourDayWeek" /> <telerik:WeekViewDefinition Title="Semana" FirstDayOfWeek="Sunday" DayStartTime="07:00" DayEndTime="20:00" CalendarWeekRule="FirstFourDayWeek" /> <telerik:MonthViewDefinition Title="Mês" FirstDayOfWeek="Sunday" DayStartTime="07:00" DayEndTime="20:00" CalendarWeekRule="FirstFourDayWeek"/> <telerik:TimelineViewDefinition Title="TimeLine" FirstDayOfWeek="Sunday" DayStartTime="07:00" DayEndTime="20:00" CalendarWeekRule="FirstFourDayWeek" Orientation="Vertical" /> </telerik:RadScheduleView.ViewDefinitions> </telerik:RadScheduleView> </Grid> </UserControl>
In my RadScheduleViewControl.xaml.cs I have:
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Telerik.Windows.Controls.ScheduleView; using Telerik.Windows.Controls; using Telerik.Windows.Controls.ScheduleView.ICalendar; using Microsoft.LightSwitch.Presentation; using System.Collections.ObjectModel; namespace LightSwitchApplication { public partial class RadScheduleViewControl : UserControl { public List<Appointment> _CoreAppointments; public List<ICategory> categories; public List<ITimeMarker> timemarkers; public RadScheduleViewControl() { InitializeComponent(); xScheduleView.Loaded += new RoutedEventHandler(xScheduleView_Loaded); } void xScheduleView_Loaded(object sender, RoutedEventArgs e) { _CoreAppointments = new List<Appointment>(); categories = new List<ICategory>(); foreach (ICategory icat in xScheduleView.CategoriesSource) { categories.Add(icat); } timemarkers = new List<ITimeMarker>(); foreach (ITimeMarker marker in xScheduleView.TimeMarkersSource) { timemarkers.Add(marker); } var resourceType_Service = new ResourceType("Serviçe"); for (int i = 0; i < 4; i++) { Resource res = new Resource("Serviçe " + i); resourceType_Service.Resources.Add(res); } var resourceType_Local = new ResourceType("Local"); resourceType_Local.AllowMultipleSelection = false; for (int i = 0; i < 4; i++) { Resource res = new Resource("Local " + i); resourceType_Local.Resources.Add(res); } var resourceTypes = new List<ResourceType>(); resourceTypes.Add(resourceType_Service); resourceTypes.Add(resourceType_Local); xScheduleView.ResourceTypesSource = resourceTypes; var GroupDescriptions = new GroupDescriptionCollection(); ResourceGroupDescription serviceGrp = new ResourceGroupDescription(); serviceGrp.ResourceType = "Serviçe"; serviceGrp.ShowNullGroup = false; GroupDescriptions.Add(serviceGrp); ResourceGroupDescription locationGrp = new ResourceGroupDescription(); locationGrp.ResourceType = "Local"; locationGrp.ShowNullGroup = false; GroupDescriptions.Add(locationGrp); xScheduleView.GroupDescriptionsSource = GroupDescriptions; }
As you can see I added two resourcetype: service and local to the AppointmentEdit window that works fine.
What I want now is load from the tables Service and Local for the possible resource values.
I want to change the values Serviçe0, ..., Service 4 and Local0, ..., Local4 for the values that I have in the Servicce and Local Tables.
How can I do that?
Any link with something like....
Thanks.