Unplanned
Last Updated: 30 Mar 2016 13:04 by ADMIN
ADMIN
Hristo
Created on: 20 Jan 2016 15:05
Category: Scheduler/Reminder
Type: Bug Report
1
FIX. RadScheduler - when grouped by resources and in Timeline view, the count of the displayed cells is decreased at the end of the RangeEndDate
Workaround:
public class MyTimelineGroupingByResourcesElement : TimelineGroupingByResourcesElement
{
    public MyTimelineGroupingByResourcesElement(RadScheduler scheduler, SchedulerView view)
        : base(scheduler, view)
    { }

    public override void NavigateForward()
    {
        TimeSpan ts = (this.View as SchedulerTimelineView).RangeEndDate - this.View.StartDate;
        int differenceInDays = ts.Days;
        int displayedCells = (this.View as SchedulerTimelineView).GetScaling().DisplayedCellsCount;

        if (differenceInDays >= displayedCells)
        {
            base.NavigateForward();
        }
    }
}

public class MyElementProvider : SchedulerElementProvider
{
    public MyElementProvider(RadScheduler scheduler)
        : base(scheduler)
    { }

    protected override T CreateElement<T>(SchedulerView view, object context)
    {
        if (typeof(T) == typeof(TimelineGroupingByResourcesElement))
        {
            return new MyTimelineGroupingByResourcesElement(this.Scheduler, view) as T;
        }

        return base.CreateElement<T>(view, context);
    }
}

 public RadForm2()
        {
            InitializeComponent();

            this.radScheduler1.ElementProvider = new MyElementProvider(this.radScheduler2);
        }
0 comments