ResourceType in AppointmentCreating

5 posts, 0 answers
  1. Arian
    Arian avatar
    3 posts
    Member since:
    Jan 2013

    Posted 30 Jul 2013 Link to this post

    In a Silverlight app using the RadScheduleView, in the AppointmentCreating event, I'm trying to create a new appointment, but I can't see how to determine which ResourceType (column) they double-clicked in.  SelectedSlot is null, and the Resources list shows a blank DisplayName and ResourceName, though the ResourceType is filled out.  is this a bug or am I doing something wrong?

    Thanks!
    -Arian
  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 31 Jul 2013 Link to this post

    Hello,

    When an user doubleclick the slot and the appointment dialog is open the SelectedSlot property should not be null. To isolate the problem I suggest you send us sample running project to test it locally. Also can you reproduce the problem with our online demo here?

    Regards,
    Rosi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Arian
    Arian avatar
    3 posts
    Member since:
    Jan 2013

    Posted 31 Jul 2013 Link to this post

    I have the control wired up in XAML like this:

    <telerikScheduler:RadScheduleView x:Name="PracticeCalendar" SelectedAppointment="{Binding SelectedPractice, Mode=TwoWay}"
    ResourceTypesSource="{Binding ResourceTypeCollection}" AppointmentsSource="{Binding PracticesCollection}" >
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="AppointmentCreating">
                <GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding CreatingPracticeCommand}" PassEventArgsToCommand="True"/>
            </i:EventTrigger>
    Then in the event handler, I have this:

    private void CreatingPractice(AppointmentCreatingEventArgs args)
    {
        var slot = (args.Source as RadScheduleView).SelectedSlot;

    I get a null for "slot" so I just don't know where to find the Resource Type of the column where the user double-clicked.  Every field related to Resource just has the ResourceType field populated.
  5. Arian
    Arian avatar
    3 posts
    Member since:
    Jan 2013

    Posted 31 Jul 2013 Link to this post

    After further digging, I saw that we had a similar function working on another page.  I tracked it all down to the CollectionChanged event handler on a Resources collection (the IList Resources property is implemented as an ObservableCollection).  The collection gets added to when double-clicked on one calendar, but not the other, even though both have nearly identical XAML declarations and resource collections.  Does this help narrow anything down?
  6. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 05 Aug 2013 Link to this post

    Hi,

    Can you try removing the following binding and tell us does the problem still persist?
    SelectedAppointment="{Binding SelectedPractice, Mode=TwoWay}"

    Regards,
    Rosi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner