Another Task Grouping Bug....

2 posts, 1 answers
  1. Eric
    Eric avatar
    48 posts
    Member since:
    Jul 2012

    Posted 13 Aug 2012 Link to this post

    Hey,

    I found a simple to reproduce bug.  When I have task A with children B and C, C with children D and E and E with children F.  I want to move D and E so their parents are A instead of C.  D works fine but E does not because it has children. This seems like this control was designed so tasks should never be moved, with the amount of problems that it causes.... Below is the full code, I am using 2012 Q2 on wpf.
    Thanks,
    Eric

    using System;
    using System.Windows;
     
    namespace Scratch
    {
        using System.Collections.ObjectModel;
     
        using Telerik.Windows.Controls.GanttView;
        using Telerik.Windows.Controls.Scheduling;
     
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
            public MainWindow()
            {
                InitializeComponent();
                var ts = new ObservableCollection<IGanttTask>();
                gantt.VisibleRange = new DateRange(DateTime.Now.AddMinutes(0), DateTime.Now.AddMinutes(6));
                gantt.PixelLength = new TimeSpan(0,0,0,1);
                gantt.TasksSource = ts;
                var a = new GanttTask { Start = DateTime.Now.AddMinutes(0), End = DateTime.Now.AddMinutes(6), Title = "A" };
                var b = new GanttTask { Start = DateTime.Now.AddMinutes(0), End = DateTime.Now.AddMinutes(1), Title = "B" };
                var c = new GanttTask { Start = DateTime.Now.AddMinutes(2), End = DateTime.Now.AddMinutes(6), Title = "C" };
                var d = new GanttTask { Start = DateTime.Now.AddMinutes(2), End = DateTime.Now.AddMinutes(3), Title = "D" };
                var e = new GanttTask { Start = DateTime.Now.AddMinutes(4), End = DateTime.Now.AddMinutes(6), Title = "E" };
                var f = new GanttTask { Start = DateTime.Now.AddMinutes(5), End = DateTime.Now.AddMinutes(6), Title = "F" };
                ts.Add(a);
                a.Children.Add(b);
                a.Children.Add(c);
                c.Children.Add(d);
                c.Children.Add(e);
                e.Children.Add(f);
     
                // The error occours In the below lines (when E is moved)
                c.Children.Remove(d);
                a.Children.Add(d);
                c.Children.Remove(e);
                a.Children.Add(e);
            }
        }
    }
    <Window x:Class="Scratch.MainWindow"
            xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GanttView"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <Controls:RadGanttView x:Name="gantt"/>
        </Grid>
    </Window>

  2. Answer
    Ventzi
    Admin
    Ventzi avatar
    114 posts

    Posted 15 Aug 2012 Link to this post

    Hi Eric,

    Please check the other forum thread regarding to this issue.

    Kind regards,
    Ventzi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top