Completed
Last Updated: 16 Aug 2016 12:27 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 15 Jul 2016 08:44
Category: GanttView
Type: Bug Report
1
FIX. RadGanttView - the graphical view is not refreshed when changing the parent of a task
Dim data As New DataSet()
Dim tasks As New DataTable("Tasks")
Dim links As New DataTable("Links")
Sub New()
    InitializeComponent()

    tasks.Columns.Add("Id", GetType(Integer))
    tasks.Columns.Add("ParentId", GetType(Integer))
    tasks.Columns.Add("Title", GetType(String))
    tasks.Columns.Add("Start", GetType(DateTime))
    tasks.Columns.Add("End", GetType(DateTime))
    tasks.Columns.Add("Progress", GetType(Decimal))

    links.Columns.Add("StartId", GetType(Integer))
    links.Columns.Add("EndId", GetType(Integer))
    links.Columns.Add("LinkType", GetType(Integer))

    data.Tables.Add(tasks)
    data.Tables.Add(links)
    tasks.Rows.Add(1, 0, "1. Summary task title", New DateTime(2010, 10, 10), New DateTime(2010, 10, 15), 30D)
    tasks.Rows.Add(2, 1, "1.1 Task", New DateTime(2010, 10, 10), New DateTime(2010, 10, 12), 10)
    tasks.Rows.Add(3, 1, "1.2 Task", New DateTime(2010, 10, 12), New DateTime(2010, 10, 15), 20D)
    tasks.Rows.Add(4, 1, "1.3 Task", New DateTime(2010, 10, 10), New DateTime(2010, 10, 11), 20D)
    tasks.Rows.Add(5, 1, "Milestone", New DateTime(2010, 10, 15), New DateTime(2010, 10, 15), 0D)
    tasks.Rows.Add(6, 0, "2. Summary task title", New DateTime(2010, 10, 10), New DateTime(2010, 10, 13), 30D)
    tasks.Rows.Add(7, 6, "2.1 Task", New DateTime(2010, 10, 10), New DateTime(2010, 10, 11), 10)
    links.Rows.Add(2, 3, 1)
    links.Rows.Add(3, 5, 1)

    Bind()
    Me.RadGanttView1.Columns.Add("Start")
    Me.RadGanttView1.Columns.Add("End")
    Me.RadGanttView1.Columns.Add("Id")
    Me.RadGanttView1.Columns.Add("ParentId")

    Me.RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = New DateTime(2010, 10, 9)
End Sub

Private Sub Bind()
    Me.RadGanttView1.GanttViewElement.DataSource = Nothing
    Me.RadGanttView1.GanttViewElement.TaskDataMember = "Tasks"
    Me.RadGanttView1.GanttViewElement.ChildMember = "Id"
    Me.RadGanttView1.GanttViewElement.ParentMember = "ParentId"
    Me.RadGanttView1.GanttViewElement.TitleMember = "Title"
    Me.RadGanttView1.GanttViewElement.StartMember = "Start"
    Me.RadGanttView1.GanttViewElement.EndMember = "End"
    Me.RadGanttView1.GanttViewElement.ProgressMember = "Progress"
    Me.RadGanttView1.GanttViewElement.LinkDataMember = "Links"
    Me.RadGanttView1.GanttViewElement.LinkStartMember = "StartId"
    Me.RadGanttView1.GanttViewElement.LinkEndMember = "EndId"
    Me.RadGanttView1.GanttViewElement.LinkTypeMember = "LinkType"
    Me.RadGanttView1.GanttViewElement.DataSource = data
End Sub

Private Sub RadButtonClick(sender As Object, e As EventArgs) Handles RadButton2.Click
    tasks(3)("ParentId") = 6
    Bind()
End Sub

Workaround: rebind the ganttview after changing the parent.
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments