Nothing happens when executing "CreateAppointment" without a timeslot selected

8 posts, 1 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 27 Jan 2011 Link to this post

    We are using a context menu for the creation of new events. Most of the time this works fine, but if I right-click outside the actual timeslots, without a timeslot selected in RadScheduleView, nothing happens. Would it be possible for you to change this so that if a timeslot is not selected when the command is executed, the new appointment would default to the first available timeslot within the currently visible range of dates?
  2. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 01 Feb 2011 Link to this post

    Can I get some input on this, please? I need to know if the component is supposed to behave like this, in which case I have to try and work around it somehow, or if I can expect this behaviour to change for the final release.

    Best regards,
    /Henrik
  3. DevCraft banner
  4. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 01 Feb 2011 Link to this post

    I would recommend workarounding this problem for now. The command was intended to return false in CanExecute when there is no selected slot. Currently it returns true because of a bug (missing implementation), that will be fixed.

    Best wishes,
    Valeri Hristov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  5. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 01 Feb 2011 Link to this post

    Ok, thanks. I guess that makes sense. My problem is that our specification requires a separate button for creating a new appointment. And that button should be available regardless of whether a timeslot is selected in the radscheduleview. The workaround I am thinking of is to handle the Click event of the button (not very MVVM, but it should work), check if a timeslot is selected, and if not, select the first available slot before executing the command manually in code-behind. Can you think of a better solution or should I give this a go?
  6. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 01 Mar 2011 Link to this post

    It would like to recommend that you change this behaviour so that we can create appointments without a slot selected. I have checked out both outlook and google calendar, and in both of these applications it is possible to create an appointment without a slot pre-selected. It just seems so unnecessary that a workaround (hack) should be required to mimic what seems to be a standard behaviour in calendar/scheduling apps.

    Best regards,
    /Henrik
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 02 Mar 2011 Link to this post

    Hi Henrik,

    What's the correct behavior in your opinion? As far as I can see, Outlook uses the currently selected appointment's Start and End to populate the New Appointment dialog. But when there are no appointments, there is always a selected slot, or at least I cannot unselect it. So what I am thinking about the behavior of the command is something like this:
    var selectedSlot = this.SelectedSlot ?? this.SelectedAppointment ?? this.GetFirstSlot(this.CurrentDate);

    where GetFirstSlot returns the first slot for the specified date.

    What do you think?

    Kind regards,
    Valeri Hristov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  8. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 08 Mar 2011 Link to this post

    Sorry for taking so long to answer this. You are right that Outlook seems to auto-select the first available slot by default. If you choose to implement it like that, I think that would be fine. But I think it is a little bit illogical that the "New Event" button (in the Outlook case) will create the event at a time that is already in the past, at leaste when you open the calendar on the current date, which is nearly always the case when you open a calendar for the first time. Google Calendar does it a little differently in that it selects the first available full hour from the current point in time. So, if you open Google Calendar at 12.30 and click "New Event", the event would be created with the time span 13.00 - 14.00. That feels more logical to me than the Outlook function, but on the other hand I will have to change that time as well. I mean, how often do you create a calendar event that starts less than an hour from now? Never, I would think. So in fact, both Google and Outlook requires me to change the default value when I create a new event, but the way it works in Google Calendar is just a little bit more logical.

    But all the above are just details. The main thing is that there is a hassle-free way to implement a "New Event" button that does not require a slot to be manually selected. If you choose to solve it by pre-selecting a slot automatically and making sure that there is always a slot selected, that is fine by me.

    Thanks,
    /Henrik
  9. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 09 Mar 2011 Link to this post

    Thanks for the feedback, Henrik. We already implemented the functionality, as I described it before. We can change it for SP1 if something is not OK.

    Greetings,
    Valeri Hristov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top
DevCraft banner