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

Another Task Grouping Bug....

1 Answer 63 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 14 Aug 2012, 12:44 AM
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>

1 Answer, 1 is accepted

Sort by
0
Accepted
Ventzi
Telerik team
answered on 15 Aug 2012, 09:02 AM
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.

Tags
GanttView
Asked by
Eric
Top achievements
Rank 1
Answers by
Ventzi
Telerik team
Share this question
or