Selecting all items when one Recurrence item is selected

3 posts, 0 answers
  1. Rajesh
    Rajesh avatar
    6 posts
    Member since:
    Jul 2011

    Posted 12 Jan 2012 Link to this post


    I have two questions regarding ScheduleView Component

    1. Is their a way to select all recurrence views associated to that appointment when any of its item is selected, i have attached a snapshot     to show how i require it when any one is selected
    2. Is there a way to hide resize button (we dont want that feature)

  2. Yana
    Yana avatar
    4603 posts

    Posted 13 Jan 2012 Link to this post

    Hi Rajesh,

    Straight to your questions:

    1. you should create a custom AppointmentSelectionBehavior in order to implement the needed requirement - just override GetSelectedAppointments method and add all the occurrences to the selection:

    protected override IEnumerable<IOccurrence> GetSelectedAppointments(AppointmentSelectionState state, IOccurrence target)
        var newSelection = Enumerable.Empty<IOccurrence>();
        var currentSelection = base.GetSelectedAppointments(state, target);
        foreach (var s in currentSelection)
            var currentOccurrence = s as Occurrence;
            if (currentOccurrence != null)
                    var occurrences = currentOccurrence.Appointment.GetOccurrences(new DateTime(2012, 1, 1), new DateTime(2012, 6, 1));
                    newSelection = newSelection.Union(occurrences);
        return newSelection.Union(currentSelection);

    2. I would suggest to create a custom DragDropBehavior and override CanResize method, please check here for more details about this.

    I've attached a simple example demonstrating both approaches. Hope it helps.

    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Moem
    Moem avatar
    4 posts
    Member since:
    Oct 2011

    Posted 21 May 2012 Link to this post

    hello yana
    thank u for this usefull code...
    i try it but i found a problem, it occurs when making an exception to a recurrence, it's selected but not moved when drop the items.
    please if any help or another code to select multiple items without recurrence.
    thank u in advance
Back to Top