Updating a Gantt chart dynamically

2 posts, 0 answers
  1. Steve
    Steve avatar
    1 posts
    Member since:
    May 2014

    Posted 22 May 2014 Link to this post

    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?
  2. Polya
    Polya avatar
    190 posts

    Posted 26 May 2014 Link to this post

    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.

    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top