RadiantQ WPF Gantt
How to listen to changes made by the end-user on the task times?
Previous Topic  Next Topic 

How to listen to changes made by the end-user on the task times?


a) The GanttControl.ActivityTimeChanged event is raised when the end-user changes the start or end time (duration) of an activity.


b) For other properties in your bound objects (like predecessor indices, etc.) as well as for StartTime and EndTime (if you want to listen to changes made to the times by the end-user and by the gantt model), make sure that your custom business objects in your model implement INotifyPropertyChanged event and also fire the PropertyChanged event when it's properties change.


Then to get notified of end-user edits of the times in the task via the table or the chart, you should listen to this event.


However, note that while loading, the GanttControl will update the Start and Effort values of the task to reflect any dependency setting and the above PropertyChanged event will be fired at that time as well.


So, to distinguish between the GanttControl changing the times during load and the end-user editing the times, you could listen to this event:


            this.ganttControl.Loaded += new RoutedEventHandler(

                delegate(object sender, RoutedEventArgs e)

                {

                    // Gantt is done changing the times of the tasks in the model, during load.

                });


PropertyChanged events raised before the Loaded event are by the GanttControl and the PropertyChanged events raised after the above Loaded event are because of the end-user.


Refer to the Samples\ProjectGantt\DataBinding\GanttControlCustomDataBinding sample for an example.



� RadiantQ 2009 - 2019. All Rights Reserved.