How to stop selecting multiple cells in C1Schedule in C#

Posted by: C_S.Kalaivanan on 13 February 2019, 7:47 pm EST

  • Posted 13 February 2019, 7:47 pm EST

    Hi,
    In C1Schedule control, we can able to multiple cells using mouse or by pressing shift key and arrow keys. I need to allow selecting only one cell to create appointment. Please guide me to achieve this functionality.


    Thanks
    Kalaivanan S
  • Marked as Answer

    Replied 14 February 2019, 5:09 pm EST

    Hi,

    You can handle SelectedIntervalChanged event, and modify the Interval according to the Schedule's current ViewType. Here's one way to do it:
    private void C1Schedule1_SelectedIntervalChanged(object sender, C1.Win.C1Schedule.SelectedIntervalChangedEventArgs e)
    {
    switch (c1Schedule1.ViewType)
    {
    case C1.Win.C1Schedule.ScheduleViewEnum.DayView:
    case C1.Win.C1Schedule.ScheduleViewEnum.TimeLineView:
    case C1.Win.C1Schedule.ScheduleViewEnum.WeekView:
    case C1.Win.C1Schedule.ScheduleViewEnum.WorkWeekView:
    e.Interval.Start = e.Interval.End.Subtract(new TimeSpan(0, 30, 0));
    break;
    case C1.Win.C1Schedule.ScheduleViewEnum.MonthView:
    e.Interval.Start = e.Interval.End.Subtract(new TimeSpan(24, 0, 0));
    break;
    }
    }


    You can also refer to the attached sample.

    Regards,
    Jitender

    SingleCellSelection.zip
  • Replied 18 February 2019, 12:03 am EST

    Hi,
    Thanks for the reply, its working for me.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels