Weird synchronizing of ResourceTypesSource between two instances of RadScheduleView

3 posts, 0 answers
  1. Jiri
    Jiri avatar
    44 posts
    Member since:
    Oct 2013

    Posted 07 Sep Link to this post

    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. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    601 posts

    Posted 12 Sep Link to this post

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    601 posts

    Posted 15 Sep Link to this post

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top