Completed
Last Updated: 15 Aug 2017 10:20 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 02 Mar 2017 11:17
Category: GanttView
Type: Bug Report
0
FIX. RadGanttView - deleting the root task doesn't remove the child tasks
To reproduce: please refer to the attached sample project and follow the steps in the gif file.

Workaround: 

private void radGanttView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.GanttViewContextMenuOpeningEventArgs e)
{
    foreach (RadMenuItem item in e.Menu.Items)
    {
        if (item.Text == "&Delete")
        {
            item.MouseDown -= item_MouseDown;
            item.MouseDown += item_MouseDown;
        }
    }
}

private void item_MouseDown(object sender, MouseEventArgs e)
{
    this.radGanttView1.GanttViewElement.BeginUpdate();

    if (this.radGanttView1.SelectedItem.Parent == null)
    {
        while (this.radGanttView1.SelectedItem.Items.Count > 0)
        {
            this.radGanttView1.SelectedItem.Items.RemoveAt(0);
        }
    }
    this.radGanttView1.GanttViewElement.EndUpdate();
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments