Completed
Last Updated: 03 Sep 2019 07:00 by ADMIN
Release R3 2019
Desislava
Created on: 21 Aug 2019 13:14
Category: GanttView
Type: Bug Report
0
RadGanttView: missing items when the parent records are added after the child records

Please use the following code snippet to setup the Gantt view:

Sub New()

                 


        InitializeComponent()

        Dim dt As New DataTable
        dt.Columns.Add("ID", GetType(Integer))
        dt.Columns.Add("Group_ID", GetType(Integer))
        dt.Columns.Add("Title", GetType(String))
        dt.Columns.Add("Start", GetType(DateTime))
        dt.Columns.Add("End", GetType(DateTime))

        dt.Rows.Add(-999, 0, "Root", New DateTime(2019, 8, 21), New DateTime(2019, 8, 30))
        dt.Rows.Add(6, -999, "Item 1", New DateTime(2019, 8, 21), New DateTime(2019, 8, 23))
        dt.Rows.Add(7, -999, "Item 2", New DateTime(2019, 8, 26), New DateTime(2019, 8, 30))
        dt.Rows.Add(1000, 6, "Sub1.1", New DateTime(2019, 8, 21), New DateTime(2019, 8, 22))
        dt.Rows.Add(1001, 6, "Sub1.2", New DateTime(2019, 8, 22), New DateTime(2019, 8, 23))
        dt.Rows.Add(1002, 6, "Sub1.3", New DateTime(2019, 8, 23), New DateTime(2019, 8, 23))
        dt.Rows.Add(1003, 7, "Sub2.1", New DateTime(2019, 8, 26), New DateTime(2019, 8, 29))



        Me.RadGanttView1.DataSource = dt
        Me.RadGanttView1.ChildMember = "ID"
        Me.RadGanttView1.ParentMember = "Group_ID"
        Me.RadGanttView1.TitleMember = "Title"
        Me.RadGanttView1.StartMember = "Start"
        Me.RadGanttView1.EndMember = "End"

        Me.RadGanttView1.Columns.Add("ID")
        Me.RadGanttView1.Columns.Add("Title")
        Me.RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = New DateTime(2019, 8, 20)
    End Sub 

However, if you switch the order of adding the rows, not all items will be visible in RadGanttView:

dt.Rows.Add(1000, 6, "Sub1.1", New DateTime(2019, 8, 21), New DateTime(2019, 8, 22))
        dt.Rows.Add(1001, 6, "Sub1.2", New DateTime(2019, 8, 22), New DateTime(2019, 8, 23))
        dt.Rows.Add(1002, 6, "Sub1.3", New DateTime(2019, 8, 23), New DateTime(2019, 8, 23))
        dt.Rows.Add(1003, 7, "Sub2.1", New DateTime(2019, 8, 26), New DateTime(2019, 8, 29))

        dt.Rows.Add(-999, 0, "Root", New DateTime(2019, 8, 21), New DateTime(2019, 8, 30))
        dt.Rows.Add(6, -999, "Item 1", New DateTime(2019, 8, 21), New DateTime(2019, 8, 23))
        dt.Rows.Add(7, -999, "Item 2", New DateTime(2019, 8, 26), New DateTime(2019, 8, 30))

0 comments