Last Updated: 15 Aug 2019 13:54 by ADMIN
Release R3 2019 (LIB 2019.2.819)
Created on: 24 Jul 2019 09:56
Category: GanttView
Type: Bug Report
RadGanttView: a newly inserted record to the DataTable is always appended at the bottom of task items

Please run the attached sample project. Select one of the child tasks and click the button. The new task is expected to be inserted at the selected item's position. However, it is appended at the bottom as it is demonstrated in the gif file.

Workaround: rebind RadGanttView after inserting a new row to the DataTable: 

    Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
            If Me.RadGanttView1.SelectedItem IsNot Nothing Then
                Dim i_rowIndex As Int32 = _dataset.Tables("Tasks").Rows.IndexOf(Me.RadGanttView1.SelectedItem.DataBoundItem.Row)
                Dim i_datarow As DataRow = _dataset.Tables("Tasks").NewRow
                Dim i_startDate As Date = New Date(Today.Year, Today.Month, Today.Day, 8, 0, 0)
                i_datarow("ID") = 3001
                i_datarow("ParentID") = _projektID
                i_datarow("Bezeichnung") = "inserted Aufgabe"
                i_datarow("Start") = i_startDate.AddHours(6 * 5)
                i_datarow("Ende") = i_startDate.AddHours(6 + 100)
                _dataset.Tables("Tasks").Rows.InsertAt(i_datarow, i_rowIndex)
                Me.RadGanttView1.DataSource = Nothing
                With Me.RadGanttView1.GanttViewElement
                    .TaskDataMember = "Tasks"
                    .ChildMember = "ID"
                    .ParentMember = "ParentID"
                    .TitleMember = "Bezeichnung"
                    .StartMember = "Start"
                    .EndMember = "Ende"
                End With
                Me.RadGanttView1.DataSource = _dataset
            End If
        Catch ex As Exception
        End Try
    End Sub