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

Updating a Gantt chart dynamically

1 Answer 250 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 22 May 2014, 06:17 PM
We'd like to add child elements to task items dynamically (post-initialization.)

Using a View-ViewModel, if I modify a given GanttTask element (which previously had no children) to add childr tasks, I see the following behavior:
- the "gantt" part of the UI changes from a text box to a ranged line
- the underlying ObservableCollection has the correct data
- however, the tree control (the part of the control that allows expand/collapse) does not appear to recognize that child tasks have been added; as a result it is impossible to view the child tasks that have been added.

How do we do this properly so the control recognizes the new child elements?

1 Answer, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 26 May 2014, 10:42 AM
Hello Steve,

The issue might occur because whenever a child GanttTask is added in the parent GanttTask we should notify for the change of the TaskSource collection.
You can take a look at our First Look demo from our QSF demos where we can add a child GanttTask at run-time when clicking on the "Add child to selected item" button.
When pressing that button the AddCommand is executed that calls the AddExecuted  method. In this method we add a new GanttTask to the selected GanttTask and then we call OnPropertyChanged(() => Tasks); to notify for the Tasks collection changed.

Regards,
Polya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GanttView
Asked by
Steve
Top achievements
Rank 1
Answers by
Polya
Telerik team
Share this question
or