This is a migrated thread and some comments may be shown as answers.

Selecting all items when one Recurrence item is selected

2 Answers 97 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 12 Jan 2012, 07:04 AM
Hi,

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)

Thanks

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 13 Jan 2012, 03:14 PM
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.

Regards,
Yana
the Telerik team

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

0
Moem
Top achievements
Rank 1
answered on 21 May 2012, 07:41 PM
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
Tags
ScheduleView
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Yana
Telerik team
Moem
Top achievements
Rank 1
Share this question
or