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

Weird synchronizing of ResourceTypesSource between two instances of RadScheduleView

2 Answers 67 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Jiri
Top achievements
Rank 1
Jiri asked on 07 Sep 2017, 01:20 PM

Hi,

We have scenario, where we need two RadScheduleViews for user to be able to use drag and drop between them.
They are both bound to the same AppointmentsSource collection but each has different ResourceTypesSource collection and here is the issue: Both these RadScheduleViews instances behave like they had the same ResourceTypesSource collection.
So it seems to me like some strange bug, especially when I am moving this functionality from Silverlight to WPF and it works OK in the Silverlight version.

So is it possible to fix this problem?

This is quite a follow up of this thread:
http://www.telerik.com/forums/freezing-row-in-timeline-view-in-radscheduleview

We are using latest version of Telerik controls.

I have prepared a MCV example where it is possible to see it, it is only not available to attach it here, but I can send it somehow.

Thank you,
Jiri

2 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 12 Sep 2017, 01:12 PM
Hello Jiri,

I'm looking into the issue but will need additional time to pinpoint its exact cause. I will inform you as soon as I have made progress on the matter.

Thank you for your patience and understanding.

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Dilyan Traykov
Telerik team
answered on 15 Sep 2017, 12:00 PM
Hello,

For the sake of the community, I'm also pasting my reply here:

"This undesired behavior comes from the fact that internally the two RadScheduleView controls use the same ICollectionView for their grouping and filtering operations. This can be overcome by providing an ICollectionViewFactory as the AppointmentsSource and implementing its CreateView method like so:

public class MyCollectionViewFactory : ObservableCollection<Appointment>, ICollectionViewFactory
{
    public object Source { get; set; }
  
    public MyCollectionViewFactory(IEnumerable<object> source)
    {
        this.Source = source;
    }
  
    public ICollectionView CreateView()
    {
        var collectionViewSource = new CollectionViewSource { Source = this.Source };
        return collectionViewSource.View;
    }
}

In addition, you're providing the same GroupDescriptionCollection to both controls. You should provide two separate instances, possibly by setting the x:Shared property of the static resource to False.

<telerik:GroupDescriptionCollection x:Shared="False" x:Key="groupDescr">
    <telerik:ResourceGroupDescription ResourceType="Bus" />
</telerik:GroupDescriptionCollection>

As a reference, I'm also attaching the modified project."

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ScheduleView
Asked by
Jiri
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or