This is a migrated thread and some comments may be shown as answers.

Readonly Slots

1 Answer 89 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 12 Feb 2013, 09:34 PM
I am attempting to set some resources to be read only in a given a view. I am doing this by creating a slot but it is making all of my resources read only. I need the end user to be able to interact with 1 of the slots.

Here is the code that I am using to set up the special slots. What else do I need to do to make this work?

private void CreateReadOnlySlots()
       {
           EventSlots = new ObservableCollection<Slot>();
 
          Slot slot = new Slot() { Start = DateTime.MinValue, End = DateTime.MaxValue};
 
          foreach (EventType e in Enum.GetValues(typeof(EventType)))
          {
              if (e != EventType.Macro)
              {
                  slot.Resources.Add(new Resource(e.ToString(), "Event Type"));
              }
          }
 
          slot.IsReadOnly = true;
          EventSlots.Add(slot);
       }

The xmal for this control looks like this
<telerik:RadScheduleView
                             AppointmentsSource="{Binding TimelineData, Mode=TwoWay}"
                             SpecialSlotsSource="{Binding EventSlots}"
                             AppointmentEdited="eventsTimeline_AppointmentEdited_1"
                             AppointmentSelectionChanged="eventsTimeline_AppointmentSelectionChanged_1"
                             NavigationHeaderVisibility="Collapsed"
                             ShowDialog="RadScheduleView_ShowDialog"
                             ResourceTypesSource="{Binding EventTypes}"                               
                             TimeRulerItemStyleSelector="{StaticResource TimeRulerItemStyleSelector}"
                             GroupHeaderStyleSelector="{StaticResource GroupHeaderStyleSelector}"
                             Name="eventsTimeline" VerticalAlignment="Top">
           <telerik:RadScheduleView.AppointmentSelectionBehavior>
               <ecu:SingleAppointmentSelectionBehavior></ecu:SingleAppointmentSelectionBehavior>
           </telerik:RadScheduleView.AppointmentSelectionBehavior>
            
           <telerik:RadScheduleView.ViewDefinitions>
               <telerik:DayViewDefinition
                   VisibleDays="1"
                   MajorTickLength="5min"
                   MinorTickLength="1min"
                   TimerulerMajorTickStringFormat="{}{0: HHmm}"
                   DayStartTime="00:00:00" DayEndTime="3:00:00" Orientation="Horizontal">
               </telerik:DayViewDefinition>
           </telerik:RadScheduleView.ViewDefinitions>
           <telerik:RadScheduleView.AppointmentStyleSelector>
               <ecu:EventStyleSelector
                       AudioEventStyle="{StaticResource AudioEvent}"
                       OdorEventStyle="{StaticResource OdorEvent}"
                       LightingEventStyle="{StaticResource LightingEvent}"
                       SmokeEventStyle="{StaticResource SmokeEvent}"/>
           </telerik:RadScheduleView.AppointmentStyleSelector>
 
           <telerik:RadScheduleView.GroupDescriptionsSource>
               <telerik:GroupDescriptionCollection>
                   <telerik:ResourceGroupDescription ResourceType="Event Types" />
               </telerik:GroupDescriptionCollection>
           </telerik:RadScheduleView.GroupDescriptionsSource>
       </telerik:RadScheduleView>

1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 15 Feb 2013, 08:41 AM
Hello Josh,

When assigning a Resource to the Slot, you should add a Resource from the Resources collection of the given ResourceType rather than creating a new Resource,  what I mean is the following code:

slot.Resources.Add(new Resource(e.ToString(), "Event Type"));

Except this, I cannot see nothing wrong with the provided code.  Please send us more details on how you're setting the resources, so we can provide further assistance.

Kind regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ScheduleView
Asked by
Josh
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or