This is a migrated thread and some comments may be shown as answers.

Ganttview Errors / Crashing

4 Answers 24 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 19 Oct 2018, 06:59 PM

I have run into several issues with the RadGanttView object that I am hoping someone else has run into as well so that they can either share experience to overcome these issues or at least tell me if perhaps these are issues that are being worked on. 

Issue 1: When adding items to the GanttView new objects do not display on the Gantt view until some sort of refresh is forced, for example collapsing and expanding one of the items.

Issue 1 Notes:
I notice this in my own project as well as the Telerik Theme Viewer example under GanttView. When all of the Items are expanded, and a new task is added it will not be displayed until any Item is collapsed and expanded again. (this is noticeable most when there are enough items that there is need to scroll down to work with the desired Item.) I notice that a new Item seems to be loaded off the view-able area of the GanttView near the bottom, but the control will not allow further scrolling downward to get to the newly created item. When I collapse and expand any element, the scroll bar auto resizes, and I am able to scroll down to the newly created item. (Under this particular circumstance I do not seem to experience the same issue with being auto scrolled to the top of the Gantt Chart as explained in more detail below in Issue 2).

Issue 2: When adding Items to the Ganttview the addition of an item causes the GanttView to scroll to the top.

Issue 2 Notes:
I notice in my own project and also the Telerik Theme Viewer example under GanttView, that if I have enough Items in the Gantt chart that if I scroll to the bottom or even about halfway down and add a new Sibling or Child that the GanttView will automatically scroll to the top of the view. I have looked for a way to be able to save the current scroll location then load that position back in after an “add operation,” but do not see a non read-only property that allows me to do this.

Issue 3: When adding the First Child to a root level Item on the GanttView where all of the root level items are collapsed, the item will be added, the GanttView will scroll to the top of the Gantt chart, and then clicking anywhere in the GanttView Graphical element will crash the program (clicking in the GanttView Text Element seems to not cause an immediate crash).

Issue 3 Notes:
To be able to more easily see the project at hand all root level items in the GanttView were collapsed. A new Root level item was added. To that root level item a new child was added. This causes all elements to expand, the GanttView to scroll to the top of the view, and upon clicking in the graphical side of the GanttView (specifically clicking on the scroll bar to scroll back down) the program crashes.
It should be noted that I add these children and root elements to the Gantt chart programmatically rather than using the GanttView right-click context menu inside my project. I seem to be unable to exactly recreate the same events inside the Telerik Theme Viewer Application so far.
Interestingly, when going through the same procedure, but with all of the root elements expanded I do not seem to experience the same issue.

 

Other issues: I have some other issues related specifically to the GanttView object, but I will hold off on asking them for the time being so as not to overwhelm anyone (I hope).  Any information, experience or knowledge of future plans (if these are known, but as yet unaddressed issues) would be greatly appreciated. Thank you in advance for your time and effort. 

 

Yours with gratitude, 

 

Matthew 

 

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 22 Oct 2018, 10:09 AM
Hello, Matthew, 

According to the provided information, it is not clear enough whether you populate the tasks programmatically or RadGanttView is bound. So, let's consider that you add the tasks via code.

Straight to your questions:

1. I have tried adding a new task either by using the context menu, or via code. Both approaches display the item as soon as it is added. Please refer to the attached gif file illustrating the behavior with my sample project. 

2. Indeed, the scrollbar will be navigated to the newly added item. However, you can store the scrollbar's value before inserting the task and then restore its value.  

private void radButton1_Click(object sender, EventArgs e)
{
    var value = this.radGanttView1.GanttViewElement.GraphicalViewElement.VScrollBar.Value;
 
    GanttViewDataItem subitem11 = new GanttViewDataItem();
    subitem11.Start = new DateTime(2010, 10, 10);
    subitem11.End = new DateTime(2010, 10, 12);
    subitem11.Progress = 10m;
    subitem11.Title = "My new item";
 
    this.radGanttView1.Items[0].Items.Add(subitem11);
     
    this.radGanttView1.GanttViewElement.GraphicalViewElement.InvalidateMeasure(true);
    this.radGanttView1.GanttViewElement.GraphicalViewElement.UpdateLayout() ;
    this.radGanttView1.GanttViewElement.GraphicalViewElement.VScrollBar.Value = value + 25;
}

3. I was unable to replicate the crash after adding a new root task to the RadGanttView. I have attached my sample project for your reference. Could you please specify the exact steps how to reproduce the problem? Thus, we would be able to investigate the precise case and assist you further. Thank you in advance.

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Matthew
Top achievements
Rank 1
answered on 22 Oct 2018, 07:58 PM

Hello Dess,

Thank you for your reply! I greatly appreciate your time and dedication in answering my questions. I have some more information for you to help diagnose what may be going on.

First to answer your question the GanttView is data bound to a SQL server where it is pulling its data from.
Also please find attached three gif files which are labeled in accordance with the issues I listed above.

AddingIssue_I.gif (Issue 1 gif)
This shows how I’m attempting to add children to a root task. Upon adding a child task I am unable to scroll down to see the rest of the pre-existent root tasks until I first collapse and expand any visible root or child task.

ScrollIssue_II.gif (Issue 2 gif)
This gif shows how when I add a child to a task, the GanttView scrolls not to the newly added item, but all the way to the top of the GanttView. Thank you for the code snippit that you provided (I’m working in VB.net, but I see what you’re doing) I seem to be getting some success using this “record position then reload” method.  I think when attempting something similar to this before I might not have been drilling down far enough into the element to get to the proper VScrollBar.Value element.

CrashIssue_III.gif (Issue 3 gif)
This gif shows how when all of the root elements are collapsed and a new child is added to a root element with no previous children, the program crashes upon trying to even scroll in using the vertical scroll bar. Towards the end of the gif you will notice that a crash report is automatically generated. I have included the full text of that crash report along the gif.

I hope that this information is useful to you in diagnosing what I am doing incorrectly or what the issue may be. I will be eagerly awaiting your reply and hope that you are well in the meantime. 

Yours with gratitude, 

 

Matthew 

0
Matthew
Top achievements
Rank 1
answered on 22 Oct 2018, 08:03 PM

Dess, 

Apologies, I accidentally attached the same gif file twice. Here is the one I left out. Sorry about that!

Hoping you are well, 

Matthew

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Oct 2018, 10:59 AM
Hello, Matthew, 

Thank you for the provided information. I setup a new form where the RadGanttView is bound to a DataSet. For the simplicity of the project and transfering it in this thread, the SQL part is eliminated and you are supposed to run the project without any difficulties. RadGanttView uses its data source to create a hierarchical data structure. To be able to do that the gantt view must be able to identify each item by a unique id. It is necessary to handle the ItemChildIdNeeded event and specify the unique identifier. The following help article is quite useful on this topic: https://docs.telerik.com/devtools/winforms/ganttview/working-with-data/adding-new-items

As to the questions at hand:

1. I was able to replicate the problem and confirm that it is an issue with the vertical scrollbar of RadGanttView. I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to update the layout and scroll to the new item: 

public RadForm2()
{
    InitializeComponent();
 
    this.radGanttView1.ItemAdded += radGanttView1_ItemAdded; 
}
 
private void radGanttView1_ItemAdded(object sender, Telerik.WinControls.UI.GanttViewItemAddedEventArgs e)
{
    item = e.Item;
}
 
GanttViewDataItem item;
 
private void radButton1_Click(object sender, EventArgs e)
{
    this.radGanttView1.GanttViewElement.InvalidateMeasure(true);
    this.radGanttView1.GanttViewElement.UpdateLayout();
 
    this.radGanttView1.GanttViewElement.GraphicalViewElement.Scroller.ScrollToItem(item);
}

2. An alternative solution is to use the GanttViewElement.GraphicalViewElement.Scroller.ScrollToItem method passing the desired GanttViewDataItem.

3. Following the provided information, I was unable to reproduce the issue you are facing. Please refer to the attached gif file illustrating the behavior on my end with the specified version. I have attached my sample project. Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GanttView
Asked by
Matthew
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or