Completed
Last Updated: 10 Nov 2014 12:26 by ADMIN
To reproduce: use the following code snippet and perform the described steps below:

Sub New()
    InitializeComponent()

    PopulateData()
End Sub

Private Sub PopulateData()

    Dim tasks As New DataTable("Tasks")
    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))

    Dim links As New DataTable("Links")
    links.Columns.Add("StartId", GetType(Integer))
    links.Columns.Add("EndId", GetType(Integer))
    links.Columns.Add("LinkType", GetType(Integer))

    Dim data As New DataSet()
    data.Tables.Add(tasks)
    data.Tables.Add(links)

    tasks.Rows.Add(1, 0, "Summary task title", New DateTime(2010, 10, 10), New DateTime(2010, 10, 15), 30D)
    tasks.Rows.Add(2, 1, "First child task title", New DateTime(2010, 10, 10), New DateTime(2010, 10, 12), 10)
    tasks.Rows.Add(3, 1, "Second child task title", New DateTime(2010, 10, 12), New DateTime(2010, 10, 15), 20D)
    tasks.Rows.Add(4, 1, "Milestone", New DateTime(2010, 10, 15), New DateTime(2010, 10, 15), 0D)

    links.Rows.Add(2, 3, 1)
    links.Rows.Add(3, 4, 1)

    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

    Me.RadGanttView1.Columns.Clear()
    Me.RadGanttView1.Columns.Add("Start")
    Me.RadGanttView1.Columns.Add("End")
    Me.RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineStart = New DateTime(2010, 10, 9)
    Me.RadGanttView1.GanttViewElement.GraphicalViewElement.TimelineEnd = New DateTime(2010, 12, 10)
End Sub

Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
    Dim selected = Me.RadGanttView1.SelectedItem.Title

    Me.RadGanttView1.DataSource = Nothing
    PopulateData()

    Dim result = FindDataItem(selected, Me.RadGanttView1.Items)

    If result IsNot Nothing Then
        Me.RadGanttView1.SelectedItem = result
    End If
End Sub

Dim found = Nothing
Private Function FindDataItem(selected As String, items As GanttViewDataItemCollection) As GanttViewDataItem

    For Each item As GanttViewDataItem In items
        If item.Title = selected Then
            Return item
        End If

        Dim itm As GanttViewDataItem = FindDataItem(selected, item.Items)

        If itm IsNot Nothing Then
            Return itm
        End If
    Next
    Return Nothing
End Function

1.Select a random task item
2.Click the button to rebind and restore the selection
As a result you will encounter a NullReferenceException.

Workaround: set the SelectedItem property to null/Nothing before rebinding
Completed
Last Updated: 19 Feb 2015 17:19 by ADMIN
To reproduce:
- Add enough items so that the vertical scroll is shown.
- Scroll so the first item is not visible.
- Move one of the visible items.
Completed
Last Updated: 20 Oct 2014 14:04 by ADMIN
Improve the way to format easily summary task. Currently you need to cast all elements of summary element to change the BackColor. 

Resolution: 
There are three properties added to GanttViewSummaryElement which allow access to the inner elements: LeftElement, MiddleElement and RightElement. 
Please take a look at the code example: 
private void radGanttView1_GraphicalViewItemFormatting(object sender, GanttViewGraphicalViewItemFormattingEventArgs e)
{
    GanttViewSummaryItemElement element = e.ItemElement as GanttViewSummaryItemElement;
    if (element != null)
    {
        GanttViewSummaryElement summary = element.TaskElement as GanttViewSummaryElement;
        summary.LeftElement.BackColor = Color.Blue;
        summary.RightElement.BackColor = Color.Blue;
        summary.MiddleElement.BackColor = Color.LightGreen;
        summary.ProgressIndicatorElement.BackColor = Color.Red;
    }
}
Approved
Last Updated: 15 Aug 2017 09:45 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: GanttView
Type: Feature Request
0
Add functionality to perform grouping over the columns in the GanttViewTextViewElement . As a result the GraphicalViewElement should be refreshed accordingly.
Completed
Last Updated: 09 Sep 2014 10:29 by ADMIN
Currently users are not able to create custom item elements for the gantt view timeline. 
Completed
Last Updated: 03 Sep 2019 07:00 by ADMIN
Release R3 2019

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))

Completed
Last Updated: 30 Apr 2018 11:16 by Dimitar
Even though you can't  modify the tasks you can see the link handles which are usually used for linking different tasks. They shouldn't be displayed when the RadGanttView is in read-only mode.

Workaround: handle the GraphicalViewItemFormatting event and manually hide the link handles: 

        private void radGanttView1_GraphicalViewItemFormatting(object sender, GanttViewGraphicalViewItemFormattingEventArgs e)
        {
            GanttGraphicalViewBaseItemElement itemElement = e.ItemElement as GanttGraphicalViewBaseItemElement;
            if (itemElement != null)
            {
                Console.WriteLine(itemElement.LeftLinkHandleElement.Visibility);
                itemElement.LeftLinkHandleElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                itemElement.LeftLinkHandleElement.PropertyChanged -= LeftLinkHandleElement_PropertyChanged;
                itemElement.LeftLinkHandleElement.PropertyChanged += LeftLinkHandleElement_PropertyChanged;
                itemElement.RightLinkHandleElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                itemElement.RightLinkHandleElement.PropertyChanged -= LeftLinkHandleElement_PropertyChanged;
                itemElement.RightLinkHandleElement.PropertyChanged += LeftLinkHandleElement_PropertyChanged;
            }
        }

        private void LeftLinkHandleElement_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            GanttViewTaskLinkHandleElement linkHanle = sender as GanttViewTaskLinkHandleElement;
            if (e.PropertyName == "Visibility" && linkHanle.Visibility == Telerik.WinControls.ElementVisibility.Visible)
            {
                linkHanle.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
            }
        }
1 2 3 4 5