Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1815
Select Mulitple appointments usign windows keys or expanded cursor
posted

I have a bound CalendarInfo for Appointments and Owners. The appointments are displayed in an UltraDayView. In one use case Users are not able to move, resie or Edit appointments in the UltraDayView I only wnat them to be able to select multiple appointments which then opens another screen where the user can do a next/ prev function to move through a person employess records for the Person that each one of the previously selected appointments relates to. I am useing the DataKey to hold the PersonId Key.

While the user can select multiple appointments it is very cumbersome to make them click seperately on each and every appointment to set its as being selected. I thought that clicking on an appointment and then pressing down the Shift Key and then the last appointment in teh day View that I want (say the first one is at 09:00 and the last one at 13:00 would select all the appointments in between 09:00 and 13:00 but it doesn't. The user is forced to click on each and every appointment starting at 09:00 and until 13:00. Is there someway that you can advise me of how to achieve this please? What is the benefit of extended under

With UltraCalendarInfo1
            .AllowAllDayEvents = False
            .AllowRecurringAppointments = False 'Disallow RecurringAppointments
            .SelectTypeActivity = UltraWinSchedule.SelectType.Extended
            .EventManager.CalendarInfo.SelectTypeActivity = UltraWinSchedule.SelectType.Extended
End With

Thank you
Parents
  • 48586
    Suggested Answer
    posted

    Hello ,

     

    In order to achieve selection of several appointments while shift key is pressed, you should  determine the time frame for which appointment should be secleted and then to select the appointments in this time frame. The code will looks like :

    Dim endDate As DateTime = UltraCalendarInfo1.SelectedAppointments.Cast(Of Infragistics.Win.UltraWinSchedule.Appointment).Max(Function(app) app.StartDateTime)

                Dim startDate As DateTime = UltraCalendarInfo1.SelectedAppointments.Cast(Of Infragistics.Win.UltraWinSchedule.Appointment).Min(Function(app) app.StartDateTime)

                UltraCalendarInfo1.SelectedAppointments.Clear()

                Dim appList As List(Of Infragistics.Win.UltraWinSchedule.Appointment) = _

                UltraCalendarInfo1.Appointments.Cast(Of Infragistics.Win.UltraWinSchedule.Appointment).Where(Function(app) app.OwnerKey = UltraDayView1.ActiveOwner.Key).Where(Function(selApp) selApp.StartDateTime >= startDate And selApp.StartDateTime <= endDate).ToList()

                appList.ForEach(AddressOf SelectAppointment)

    Also I have implemented my suggestion in a small sample. Please run the sample and let me know if this is what you are looking for.

     

    Please let me know if you have any further questions.

Reply Children