Syncfusion.Grid.WPF
Syncfusion.GridCommon.WPF
@@ -29,8 +29,8 @@ Syncfusion.Themes.MaterialLight.WPF
## Namespace
-| Removed namespaces |
-Added namespace |
+Removed Namespaces |
+Added Namespaces |
Syncfusion.Windows.Controls.Gantt.Grid
Syncfusion.Windows.Controls.Gantt.Schedule
@@ -43,9 +43,9 @@ Syncfusion.Windows.Controls.Gantt.Chart |
### Class
-| Class Name |
-Existing base class |
-New base class |
+Class Names |
+Existing Base Classes |
+New Base Classes |
@@ -58,10 +58,10 @@ Syncfusion.Windows.Controls.Gantt.Chart
### Properties
-| Existing API type |
-Existing API name |
-New API type |
-New API Name |
+Existing API Types |
+Existing API Names |
+New API Types |
+New API Names |
@@ -96,8 +96,8 @@ Syncfusion.Windows.Controls.Gantt.Chart
### Methods
-| Existing method |
-New method |
+Existing Methods |
+New Methods |
@@ -114,10 +114,10 @@ Syncfusion.Windows.Controls.Gantt.Chart
### Events
-| Existing structure |
-Existing name |
-New structure |
-New name |
+Existing Structures |
+Existing Names |
+New Structures |
+New Names |
@@ -150,10 +150,10 @@ Syncfusion.Windows.Controls.Gantt.Chart
### Enums
-| Existing name |
-Existing members |
-New name |
-New members |
+Existing Names |
+Existing Members |
+New Names |
+New Members |
@@ -221,8 +221,8 @@ VS2010
### Removed public classes
-| Class name |
-Base class |
+Class Names |
+Base Classes |
@@ -267,9 +267,9 @@ VS2010
### Removed API
-| Class name |
-Property type |
-Property name |
+Class Names |
+Property Types |
+Property Names |
@@ -282,10 +282,10 @@ VS2010
## Access type changed classes
-| Class name |
-Base class |
-Existing access type |
-Changed access type |
+Class Names |
+Base Classes |
+Existing Access Types |
+Changed Access Types |
@@ -308,10 +308,10 @@ VS2010
### Properties
-| Name |
-Type |
-Default value |
-Summary |
+Names |
+Types |
+Default Values |
+Summaries |
@@ -346,9 +346,9 @@ VS2010
### Events
-| Event name |
-EventArg name |
-Summary |
+Event Names |
+EventArg Names |
+Summaries |
@@ -388,8 +388,8 @@ To make the migration from GridTreeControl to SfTreeGrid, integrating drag-and-d
### Assembly references
-| Removed assemblies |
-Added assemblies |
+Removed Assemblies |
+Added Assemblies |
@@ -452,8 +452,8 @@ Syncfusion.GridCommon.WPF
#### ExpandStateChanging
-| GridTreeControl commands |
-SfTreeGrid commands |
+GridTreeControl Commands |
+SfTreeGrid Commands |
@@ -497,8 +497,8 @@ GanttGridNodeCollapsingCommand
#### ExpandStateChanged
-| GridTreeControl commands |
-SfTreeGrid commands |
+GridTreeControl Commands |
+SfTreeGrid Commands |
@@ -542,9 +542,9 @@ GanttGridNodeCollapsedCommand
These events are deprecated. The GridTreeControl has been replaced by the SfTreeGrid in the GanttControl.
-| Structure |
-Event name |
-Summary |
+Structures |
+Event Names |
+Summaries |
diff --git a/wpf/Gantt/resource-view-gantt-inline-items.md b/wpf/Gantt/resource-view-gantt-inline-items.md
index dbc8feea23..f0af942df2 100644
--- a/wpf/Gantt/resource-view-gantt-inline-items.md
+++ b/wpf/Gantt/resource-view-gantt-inline-items.md
@@ -53,64 +53,588 @@ To populate a Resource view Gantt in a Custom Numeric Schedule:
1. Define the Gantt with a custom numeric schedule source. For more information about custom numeric schedules, visit the following link:
2. You can populate the collection of tasks in a single row by mapping the corresponding field in the underlying source to the InLineTaskMapping.
-The following code illustrates this.
-
-
+{% tabs %}
{% highlight xaml %}
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{% endhighlight %}
-The following code is the sample data source of a resource view Gantt in a custom numeric schedule.
-
-
{% highlight c# %}
+this.Gantt.ScheduleType = ScheduleType.CustomNumeric;
+this.ganttControl.ItemsSource = new ViewModel().Items;
-ObservableCollection- teams = new ObservableCollection
- ();
-teams.Add(new Item() { Name = "RDU Team" });
+// Task attribute mapping
+TaskAttributeMapping taskAttributeMapping = new TaskAttributeMapping();
+taskAttributeMapping.TaskNameMapping = "Name";
+taskAttributeMapping.StartPointMapping = "StartDate";
+taskAttributeMapping.ChildMapping = "SubItems";
+taskAttributeMapping.FinishPointMapping = "End";
+taskAttributeMapping.InLineTaskMapping = "InLineItems";
+this.ganttControl.TaskAttributeMapping = taskAttributeMapping;
-Item Person = new Item() { Name = "Robert" };
-Person.InLineItems.Add(new Item() { Start =0, End=2, Name = "Market Analysis", Progress = 50d });
-Person.InLineItems.Add(new Item() { Start =2, End=4, Name = "Competitor Analysis", Progress = 20d });
-Person.InLineItems.Add(new Item() { Start = 3, End = 6,Name = "Design Spec" });
-teams[0].SubItems.Add(Person);
-
-Person = new Item() { Name = "Michael" };
-Person.InLineItems.Add(new Item() { Start = 2, End = 4, Name = "Basic Requirement Analysis", Progress = 40 });
-Person.InLineItems.Add(new Item() { Start = 5, End = 7, Name = "Requirement Spec" });
-teams[0].SubItems.Add(Person);
+{% endhighlight %}
-Person = new Item() { Name = "Anne" };
-Person.InLineItems.Add(new Item() { Start = 0, End = 2, Name = "Estimation", Progress = 30 });
-Person.InLineItems.Add(new Item() { Start = 3, End = 6, Name = "Budget & Plan Spec" });
-teams[0].SubItems.Add(Person);
+{% highlight c# tabtitle="Task.cs" %}
+public class Item : NotificationObject
+{
+ ///
+ /// Holds the id value.
+ ///
+ private int id;
+
+ ///
+ /// Holds the name value.
+ ///
+ private string name;
+
+ //
+ /// Holds the end value.
+ ///
+ private double _end;
+
+ ///
+ /// Holds the progress value.
+ ///
+ private double _progress = 100;
+
+ ///
+ /// Holds the start value.
+ ///
+ private double _start;
+
+ ObservableCollection
- _subItems = new ObservableCollection
- ();
+ ObservableCollection
- _inLineItems = new ObservableCollection
- ();
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public Item()
+ {
+ this._subItems.CollectionChanged += ItemsCollectionChanged;
+ this._inLineItems.CollectionChanged += ItemsCollectionChanged;
+ }
+
+ ///
+ /// Gets or sets the name.
+ ///
+ /// The name.
+ public string Name
+ {
+ get
+ {
+ return this.name;
+ }
+ set
+ {
+ this.name = value;
+ RaisePropertyChanged("Name");
+ }
+ }
+
+
+ ///
+ /// Gets or sets the start date.
+ ///
+ /// The start date.
+ public double Start
+ {
+ get
+ {
+ return this._start;
+ }
+ set
+ {
+ this._start = value;
+ RaisePropertyChanged("StartDate");
+ }
+ }
+
+ ///
+ /// Gets or sets the finish date.
+ ///
+ /// The finish date.
+ public double End
+ {
+ get
+ {
+ return this._end;
+ }
+ set
+ {
+ this._end = value;
+ RaisePropertyChanged("FinishDate");
+ }
+ }
+
+ ///
+ /// Gets or sets the progress.
+ ///
+ /// The progress.
+ public double Progress
+ {
+ get
+ {
+ return this._progress;
+ }
+ set
+ {
+ this._progress = value;
+ RaisePropertyChanged("Progress");
+ }
+ }
+
+ ///
+ /// Gets or sets the sub items.
+ ///
+ /// The sub items.
+ public ObservableCollection
- SubItems
+ {
+ get
+ {
+ return this._subItems;
+ }
+ set
+ {
+ this._subItems = value;
+
+ this._subItems.CollectionChanged += ItemsCollectionChanged;
+
+ if (value.Count > 0)
+ {
+ this._subItems.ToList().ForEach(n =>
+ {
+ /// To listen the changes occuring in child task.
+ n.PropertyChanged += ItemPropertyChanged;
+ });
+ UpdateDates();
+ }
+
+ this.RaisePropertyChanged("SubItems");
+ }
+ }
+
+ ///
+ /// Gets or sets the in line items.
+ ///
+ /// The in line items.
+ public ObservableCollection
- InLineItems
+ {
+ get
+ {
+ return this._inLineItems;
+ }
+ set
+ {
+ this._inLineItems = value;
+
+ this._inLineItems.CollectionChanged += ItemsCollectionChanged;
+
+ if (value.Count > 0)
+ {
+ this._inLineItems.ToList().ForEach(n =>
+ {
+ /// To listen the changes occuring in child task.
+ n.PropertyChanged += ItemPropertyChanged;
+ });
+ UpdateDates();
+ }
+
+ this.RaisePropertyChanged("InLineItems");
+ }
+ }
+
+ ///
+ /// Itemses the collection changed.
+ ///
+ /// The sender.
+ /// The instance containing the event data.
+ void ItemsCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
+ {
+ if (e.Action == NotifyCollectionChangedAction.Add)
+ {
+ foreach (Item item in e.NewItems)
+ {
+ item.PropertyChanged += ItemPropertyChanged;
+ }
+ }
+ else
+ {
+ foreach (Item item in e.OldItems)
+ item.PropertyChanged -= ItemPropertyChanged;
+ }
+ UpdateDates();
+ }
+
+ ///
+ /// Items the property changed.
+ ///
+ /// The sender.
+ /// The instance containing the event data.
+ void ItemPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName != null)
+ if (e.PropertyName == "Start" || e.PropertyName == "End" || e.PropertyName == "Progress")
+ {
+ UpdateDates();
+ }
+ }
+
+ ///
+ /// Updates the dates.
+ ///
+ private void UpdateDates()
+ {
+ var tempCal = 0d;
+
+ if (this._subItems.Count > 0)
+ {
+ /// Updating the start and end date based on the chagne occur in the date of child task
+ Start = _subItems.Select(c => c.Start).Min();
+ End = _subItems.Select(c => c.End).Max();
+ Progress = (this._subItems.Aggregate(tempCal, (cur, task) => cur + task.Progress)) / this._subItems.Count;
+ }
+
+ if (this._inLineItems.Count > 0)
+ {
+ /// Updating the start and end date based on the chagne occur in the date of child task
+ Start = _inLineItems.Select(c => c.Start).Min();
+ Start = _inLineItems.Select(c => c.Start).Max();
+ Progress = (this._inLineItems.Aggregate(tempCal, (cur, task) => cur + task.Progress)) / this._inLineItems.Count;
+ }
+ }
+}
-teams.Add(new Item() { Name = "Graphics Team" });
+{% endhighlight %}
-Person = new Item() { Name = "Madhan" };
-Person.InLineItems.Add(new Item() { Start = 0, End = 3, Name = "Identifying UI modules", Progress = 40 });
-Person.InLineItems.Add(new Item() { Start = 2, End = 5, Name = "Defining UI Design" });
-teams[1].SubItems.Add(Person);
+{% highlight c# tabtitle="ViewModel.cs" %}
+
+public class ViewModel
+{
+ ///
+ /// Holds the items.
+ ///
+ private ObservableCollection
- _items;
+
+ ///
+ /// Holds the custom schedule information.
+ ///
+ private ObservableCollection _customScheduleInfo;
+
+ public ViewModel()
+ {
+ this._items = GetData();
+ this._customScheduleInfo = GetCustomScheduleInfo();
+ }
+
+ ///
+ /// Collection which is used to store the CountryNamesWith their Flags
+ ///
+ internal static Dictionary CountryNamesandFlags = new Dictionary();
+
+ ///
+ /// Gets or sets the custom schedule info.
+ ///
+ /// The custom schedule info.
+ public ObservableCollection CustomScheduleInfo
+ {
+ get
+ {
+ return this._customScheduleInfo;
+ }
+ set
+ {
+ this._customScheduleInfo = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the appointment item source.
+ ///
+ /// The appointment item source.
+ public ObservableCollection
- Items
+ {
+ get
+ {
+ return this._items;
+ }
+ set
+ {
+ this._items = value;
+ }
+ }
+
+
+ ///
+ /// Gets the Numeric Schedule Items Info
+ ///
+ /// The row information
+ private ObservableCollection GetCustomScheduleInfo()
+ {
+ ObservableCollection RowInfo = new ObservableCollection();
+ RowInfo.Add(new GanttScheduleRowInfo() { CellsPerUnit = 5 });
+ RowInfo.Add(new GanttScheduleRowInfo() { CellsPerUnit = 2, PixelsPerUnit = 30d });
+ return RowInfo;
+ }
+
+ ///
+ /// Gets the data.
+ ///
+ /// The teams
+ public ObservableCollection
- GetData()
+ {
+ ObservableCollection
- teams = new ObservableCollection
- ();
+ teams.Add(new Item() { Name = "RDU Team" });
+
+ Item person = new Item() { Name = "Robert" };
+ person.InLineItems.Add(new Item() { Start = 0, End = 2, Name = "Market Analysis", Progress = 50 });
+ person.InLineItems.Add(new Item() { Start = 2, End = 4, Name = "Competitor Analysis", Progress = 20 });
+ person.InLineItems.Add(new Item() { Start = 3, End = 6, Name = "Design Spec" });
+ teams[0].SubItems.Add(person);
+
+ person = new Item() { Name = "Michael" };
+ person.InLineItems.Add(new Item() { Start = 2, End = 4, Name = "Basic Requirement Analysis", Progress = 40 });
+ person.InLineItems.Add(new Item() { Start = 5, End = 7, Name = "Requirement Spec" });
+ teams[0].SubItems.Add(person);
+
+ person = new Item() { Name = "Anne" };
+ person.InLineItems.Add(new Item() { Start = 0, End = 2, Name = "Estimation", Progress = 30 });
+ person.InLineItems.Add(new Item() { Start = 3, End = 6, Name = "Budget & Plan Spec" });
+ teams[0].SubItems.Add(person);
+
+ teams.Add(new Item() { Name = "Graphics Team" });
+
+ person = new Item() { Name = "Madhan" };
+ person.InLineItems.Add(new Item() { Start = 0, End = 3, Name = "Identifying UI modules", Progress = 40 });
+ person.InLineItems.Add(new Item() { Start = 2, End = 5, Name = "Defining UI Design" });
+ teams[1].SubItems.Add(person);
+ return teams;
+ }
+}
{% endhighlight %}
+{% endtabs %}
The following shows the Resultant output:
-
+
#### Resource View Gantt with a Date-Time Schedule
@@ -119,77 +643,618 @@ To populate the Resource view Gantt with a date-time schedule:
1. Define the Gantt with DateTime values.
2. Populate the collection of tasks in a single row by mapping the corresponding field in the underlying source to the InLineTaskMapping.
-The following code sample illustrates this:
-
-
+{% tabs %}
{% highlight xaml %}
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{% endhighlight %}
-The following is the sample data source for the resource view Gantt:
{% highlight c# %}
+this.ganttControl.ItemsSource = new ViewModel().Items;
+// Task attribute mapping
+TaskAttributeMapping taskAttributeMapping = new TaskAttributeMapping();
+taskAttributeMapping.TaskNameMapping = "Name";
+taskAttributeMapping.StartPointMapping = "StartDate";
+taskAttributeMapping.ChildMapping = "SubItems";
+taskAttributeMapping.FinishPointMapping = "End";
+taskAttributeMapping.InLineTaskMapping = "InLineItems";
+this.ganttControl.TaskAttributeMapping = taskAttributeMapping;
+{% endhighlight %}
+
+{% highlight c# tabtitle="Task.cs" %}
+
+ public class Item : NotificationObject
+ {
+ ///
+ /// Holds the name value.
+ ///
+ string _name;
+
+ ///
+ /// Holds the start date value.
+ ///
+ DateTime _startDate;
+
+ ///
+ /// Holds the end date value.
+ ///
+ DateTime _finishDate;
+
+ ///
+ /// Holds the progress value.
+ ///
+ double _progress;
+
+ ///
+ /// Holds the sub items.
+ ///
+ ObservableCollection
- _subItems = new ObservableCollection
- ();
+
+ ///
+ /// Holds the inline items.
+ ///
+ ObservableCollection
- _inLineItems = new ObservableCollection
- ();
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public Item()
+ {
+ _subItems.CollectionChanged += ItemsCollectionChanged;
+ _inLineItems.CollectionChanged += ItemsCollectionChanged;
+ }
+
+ ///
+ /// Gets or sets the name.
+ ///
+ /// The name.
+ public string Name
+ {
+ get
+ {
+ return this._name;
+ }
+ set
+ {
+ this._name = value;
+ RaisePropertyChanged("Name");
+ }
+ }
+
+
+ ///
+ /// Gets or sets the start date.
+ ///
+ /// The start date.
+ public DateTime StartDate
+ {
+ get
+ {
+ return this._startDate;
+ }
+ set
+ {
+ this._startDate = value;
+ RaisePropertyChanged("StartDate");
+ }
+ }
+
+ ///
+ /// Gets or sets the finish date.
+ ///
+ /// The finish date.
+ public DateTime FinishDate
+ {
+ get
+ {
+ return this._finishDate;
+ }
+ set
+ {
+ this._finishDate = value;
+ RaisePropertyChanged("FinishDate");
+ }
+ }
+
+ ///
+ /// Gets or sets the progress.
+ ///
+ /// The progress.
+ public double Progress
+ {
+ get
+ {
+ return Math.Round(this._progress, 2);
+ }
+ set
+ {
+ this._progress = value;
+ RaisePropertyChanged("Progress");
+ }
+ }
+
+ ///
+ /// Gets or sets the sub items.
+ ///
+ /// The sub items.
+ public ObservableCollection
- SubItems
+ {
+ get
+ {
+ return this._subItems;
+ }
+ set
+ {
+ this._subItems = value;
+
+ this._subItems.CollectionChanged += ItemsCollectionChanged;
+
+ if (value.Count > 0)
+ {
+ this._subItems.ToList().ForEach(n =>
+ {
+ /// To listen the changes occuring in child task.
+ n.PropertyChanged += ItemPropertyChanged;
+ });
+ UpdateDates();
+ }
+
+ this.RaisePropertyChanged("SubItems");
+ }
+ }
+
+ ///
+ /// Gets or sets the in line items.
+ ///
+ /// The in line items.
+ public ObservableCollection
- InLineItems
+ {
+ get
+ {
+ return this._inLineItems;
+ }
+ set
+ {
+ this._inLineItems = value;
+
+ this._inLineItems.CollectionChanged += ItemsCollectionChanged;
+
+ if (value.Count > 0)
+ {
+ this._inLineItems.ToList().ForEach(n =>
+ {
+ /// To listen the changes occuring in child task.
+ n.PropertyChanged += ItemPropertyChanged;
+ });
+ UpdateDates();
+ }
+
+ this.RaisePropertyChanged("InLineItems");
+ }
+ }
+
+ ///
+ /// Itemses the collection changed.
+ ///
+ /// The sender.
+ /// The instance containing the event data.
+ void ItemsCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
+ {
+ if (e.Action == NotifyCollectionChangedAction.Add)
+ {
+ foreach (Item item in e.NewItems)
+ {
+ item.PropertyChanged += ItemPropertyChanged;
+ }
+ }
+ else
+ {
+ foreach (Item item in e.OldItems)
+ {
+ item.PropertyChanged -= ItemPropertyChanged;
+ }
+ }
+
+ this.UpdateDates();
+ }
+
+ ///
+ /// Items the property changed.
+ ///
+ /// The sender.
+ /// The instance containing the event data.
+ void ItemPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName != null)
+ if (e.PropertyName == "StartDate" || e.PropertyName == "FinishDate" || e.PropertyName == "Progress")
+ {
+ UpdateDates();
+ }
+ }
+
+ ///
+ /// Updates the dates.
+ ///
+ private void UpdateDates()
+ {
+ var tempCal = 0d;
+
+ if (_subItems.Count > 0)
+ {
+ /// Updating the start and end date based on the chagne occur in the date of child task
+ StartDate = _subItems.Select(c => c.StartDate).Min();
+ FinishDate = _subItems.Select(c => c.FinishDate).Max();
+ Progress = (_subItems.Aggregate(tempCal, (cur, task) => cur + task.Progress)) / _subItems.Count;
+ }
+
+ if (_inLineItems.Count > 0)
+ {
+ /// Updating the start and end date based on the chagne occur in the date of child task
+ StartDate = _inLineItems.Select(c => c.StartDate).Min();
+ FinishDate = _inLineItems.Select(c => c.FinishDate).Max();
+ Progress = (_inLineItems.Aggregate(tempCal, (cur, task) => cur + task.Progress)) / _inLineItems.Count;
+ }
+ }
+ }
+{% endhighlight %}
-ObservableCollection
- teams = new ObservableCollection
- ();
-teams.Add(new Item() { Name = "RDU Team" });
-Item Person = new Item() { Name = "Robert" };
-Person.InLineItems.Add(new Item(){ StartDate = new DateTime(2012, 01, 07), FinishDate = new DateTime(2012, 01, 11), Name = "Market Analysis", Progress = 50d });
-Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 11), FinishDate = new DateTime(2012, 01, 15), Name = "Competitor Analysis", Progress = 20d });
-Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 13), FinishDate = new DateTime(2012, 01, 19), Name = "Design Spec" });
-teams[0].SubItems.Add(Person);
-Person = new Item() { Name = "Michael" };
-Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 18), FinishDate = new DateTime(2012, 01, 19), Name = "Basic Requirement Analysis", Progress = 40 });
-Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 19), FinishDate = new DateTime(2012, 01, 21), Name = "Requirement Spec" });
-teams[0].SubItems.Add(Person);
-Person = new Item() { Name = "Anne" };
-Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 21), FinishDate = new DateTime(2012, 01, 24), Name = "Estimation", Progress = 30 });
-Person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 24), FinishDate = new DateTime(2012, 01, 26), Name = "Budget & Plan Spec" });
-teams[0].SubItems.Add(Person);
+{% highlight c# tabtitle="ViewModel.cs" %}
+
+public class ViewModel
+{
+ ///
+ /// Holds the team details.
+ ///
+ private ObservableCollection
- _teamDetails;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ViewModel()
+ {
+ this._teamDetails = GetTeamInfo();
+ }
+
+ ///
+ /// Gets or sets the appointment item source.
+ ///
+ /// The appointment item source.
+ public ObservableCollection
- TeamDetails
+ {
+ get
+ {
+ return this._teamDetails;
+ }
+ set
+ {
+ this._teamDetails = value;
+ }
+ }
+
+ ///
+ /// Gets the team info.
+ ///
+ /// The teams
+ public ObservableCollection
- GetTeamInfo()
+ {
+ DateTime dateTime = DateTime.Today;
+ ObservableCollection
- teams = new ObservableCollection
- ();
+
+ teams.Add(new Item() { Name = "RDU Team" });
+ Item person = new Item() { Name = "Robert" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 07), FinishDate = new DateTime(2012, 01, 11), Name = "Market Analysis", Progress = 50d });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 11, 12, 0, 0), FinishDate = new DateTime(2012, 01, 17), Name = "Competitor Analysis", Progress = 20d });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 17, 12, 0, 0), FinishDate = new DateTime(2012, 01, 21), Name = "Design Spec" });
+ teams[0].SubItems.Add(person);
+
+ person = new Item() { Name = "Michael" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 14), FinishDate = new DateTime(2012, 01, 19), Name = "Basic Requirement Analysis", Progress = 40 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 19, 12, 0, 0), FinishDate = new DateTime(2012, 01, 23), Name = "Requirement Spec" });
+ teams[0].SubItems.Add(person);
+
+ person = new Item() { Name = "Anne" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 21), FinishDate = new DateTime(2012, 01, 25), Name = "Estimation", Progress = 30 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 25, 12, 0, 0), FinishDate = new DateTime(2012, 01, 29, 12, 0, 0), Name = "Budget & Plan Spec" });
+ teams[0].SubItems.Add(person);
+
+ teams.Add(new Item() { Name = "Graphics Team" });
+ person = new Item() { Name = "Madhan" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 17), FinishDate = new DateTime(2012, 01, 21), Name = "Identifying UI modules", Progress = 40 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 21, 12, 0, 0), FinishDate = new DateTime(2012, 01, 26), Name = "Defining UI Design" });
+ teams[1].SubItems.Add(person);
+
+ person = new Item() { Name = "Peter" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 21), FinishDate = new DateTime(2012, 01, 24), Name = "Designing Animagions", Progress = 40 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 24, 12, 0, 0), FinishDate = new DateTime(2012, 01, 28), Name = "Completing Overall Graphics design" });
+ teams[1].SubItems.Add(person);
+
+ teams.Add(new Item() { Name = "Dev Team" });
+ person = new Item() { Name = "Ruban" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 19), FinishDate = new DateTime(2012, 01, 22), Name = "Analysis", Progress = 30 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 22, 12, 0, 0), FinishDate = new DateTime(2012, 01, 26), Name = "Defining Modules", Progress = 10 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 26, 12, 0, 0), FinishDate = new DateTime(2012, 01, 30), Name = "Development Plan", Progress = 10 });
+ teams[2].SubItems.Add(person);
+
+ person = new Item() { Name = "Karthick" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 20), FinishDate = new DateTime(2012, 01, 22, 12, 0, 0), Name = "Analysis", Progress = 10 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 23), FinishDate = new DateTime(2012, 1, 29), Name = "Module Development" });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 29, 12, 0, 0), FinishDate = new DateTime(2012, 02, 2), Name = "Self Testing" });
+ teams[2].SubItems.Add(person);
+
+ person = new Item() { Name = "Suyama" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 21), FinishDate = new DateTime(2012, 01, 24), Name = "Analysis", Progress = 10 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 24, 12, 0, 0), FinishDate = new DateTime(2012, 01, 31), Name = "Module Development" });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 02, 1), FinishDate = new DateTime(2012, 02, 4), Name = "Self Testing" });
+ teams[2].SubItems.Add(person);
+
+ person = new Item() { Name = "Albert" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 27), FinishDate = new DateTime(2012, 01, 31), Name = "Modules Integration" });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 31, 12, 0, 0), FinishDate = new DateTime(2012, 02, 4), Name = "Integration Testing" });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 02, 5), FinishDate = new DateTime(2012, 02, 8, 12, 0, 0), Name = "Completeness" });
+ teams[2].SubItems.Add(person);
+
+ teams.Add(new Item() { Name = "Doc Team" });
+ person = new Item() { Name = "Laura" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 02, 02), FinishDate = new DateTime(2012, 02, 07), Name = "User Guide Development", Progress = 10 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 02, 08), FinishDate = new DateTime(2012, 02, 11), Name = "Publishing User Guide", Progress = 10 });
+ teams[3].SubItems.Add(person);
+
+ person = new Item() { Name = "Margaret" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 02, 05), FinishDate = new DateTime(2012, 02, 08), Name = "Web Conetent Development", Progress = 10 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 02, 08, 12, 0, 0), FinishDate = new DateTime(2012, 02, 12), Name = "Publishing Web Conetent", Progress = 10 });
+ teams[3].SubItems.Add(person);
+
+ teams.Add(new Item() { Name = "Sales Team" });
+ person = new Item() { Name = "Steven" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 13), FinishDate = new DateTime(2012, 01, 17), Name = "Defining Target", Progress = 80 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 18), FinishDate = new DateTime(2012, 01, 22), Name = "Defining Startegy", Progress = 50 });
+ teams[4].SubItems.Add(person);
+
+ person = new Item() { Name = "Janet" };
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 01, 21), FinishDate = new DateTime(2012, 01, 26), Name = "Collect Customers list", Progress = 50 });
+ person.InLineItems.Add(new Item() { StartDate = new DateTime(2012, 02, 09), FinishDate = new DateTime(2012, 02, 14), Name = "Contacting Customer" });
+ teams[4].SubItems.Add(person);
+ return teams;
+ }
+}
{% endhighlight %}
+{% endtabs %}
Output
The following image shows the resultant output:
-
-
-
-
-
-
-
+
## Data Structure
The following is the data structure used to build a Resource view Gantt:
-
-

-
-
* team holds information about the team.
* SubItems of Team will hold the list of Resources in that particular team.
* InLineItems of each Resource will hold the tasks assigned to the particular resource.
diff --git a/wpf/Gantt/strip-lines.md b/wpf/Gantt/strip-lines.md
index 5711624832..4a135499f5 100644
--- a/wpf/Gantt/strip-lines.md
+++ b/wpf/Gantt/strip-lines.md
@@ -229,22 +229,75 @@ Event
#### Regular strip lines
-The following code sample demonstrates how to define a collection of regular strip lines.
+The following code sample demonstrates how to bind the regular strip line collection to strip lines.
-{% highlight c# %}
+{% tabs %}
+{% highlight xaml %}
+
+
+
+
+
+
+
+
+
+{% endhighlight %}
+
+{% highlight c# %}
-StripCollection = new List();
+this.ganttControl.ItemsSource = new ViewModel().TaskCollection;
+this.ganttControl.ShowStripLines = true;
+
+// Task attribute mapping
+TaskAttributeMapping taskAttributeMapping = new TaskAttributeMapping();
+taskAttributeMapping.TaskIdMapping = "TaskId";
+taskAttributeMapping.TaskNameMapping = "TaskName";
+taskAttributeMapping.StartDateMapping = "StartDate";
+taskAttributeMapping.ChildMapping = "Child";
+taskAttributeMapping.FinishDateMapping = "FinishDate";
+taskAttributeMapping.DurationMapping = "Duration";
+taskAttributeMapping.MileStoneMapping = "IsMileStone";
+taskAttributeMapping.PredecessorMapping = "Predecessor";
+taskAttributeMapping.ProgressMapping = "Progress";
+taskAttributeMapping.ResourceInfoMapping = "Resource";
+this.ganttControl.TaskAttributeMapping = taskAttributeMapping;
+
+List stripCollection = new List();
//Getting the collection of StripLineInfo
-StripCollection = GetStripCollection();
+stripCollection = GetStripCollection();
+
+//Property for strip collection.
+public List StripCollection
+{
+ get
+ {
+ return this.stripCollection;
+ }
+ set
+ {
+ this.stripCollection = value;
+ RaisePropertyChanged("StripCollection");
+ }
+}
//Method will return the collection StripLineInfo
private List GetStripCollection()
-
{
- List stripCollection = new List();
- stripCollection.Add(new StripLineInfo()
+ this.stripCollection.Add(new StripLineInfo()
{
Content = "Weekly Team Meeting",
StartDate = new DateTime(2012, 6, 4),
@@ -255,107 +308,326 @@ private List GetStripCollection()
RepeatUpto = new DateTime(2012, 12, 10),
});
- return stripCollection;
+ return this.stripCollection;
}
+ {% endhighlight %}
-{% endhighlight %}
-
-The following code sample demonstrates how to bind the regular strip line collection to strip lines.
-
-{% highlight xaml %}
+ {% highlight c# tabtitle="ViewModel.cs" %}
+ public class ViewModel
+ {
+ ///
+ /// Holds the task collections.
+ ///
+ private ObservableCollection taskCollections;
-
-
-
-
-
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ViewModel()
+ {
+ this.taskCollections = GetData();
+ }
+
+ ///
+ /// Gets or sets the appointment item source.
+ ///
+ /// The appointment item source.
+ public ObservableCollection TaskCollection
+ {
+ get
+ {
+ return this.taskCollections;
+ }
+ set
+ {
+ this.taskCollections = value;
+ }
+ }
+
+ ///
+ /// Gets the data.
+ ///
+ /// The task details
+ public ObservableCollection GetData()
+ {
+ var taskDetails = new ObservableCollection();
+
+ taskDetails.Add(new TaskDetails() { TaskId = 1, TaskName = "Analysis/Planning", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 2, TaskName = "Identify Components to be Localized", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 3, TaskName = "Ensure file localizability", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 4, TaskName = "Identify tools", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 5, TaskName = "Test tools", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 8, 1), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 6, TaskName = "Develop delivery timeline", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 8, 1), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 7, TaskName = "Analysis Complete", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 8, 10), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 8, TaskName = "Production", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 9, TaskName = "Software Components", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 10, TaskName = "Localization Component - User Interface", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 11, TaskName = "User Assistance Components", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 12, TaskName = "Software components complete", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 13, TaskName = "Quality Assurance", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 12), Progress = 40d, });
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 14, TaskName = "Review project information", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 15), Progress = 20d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 15, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 8), Progress = 20d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 16, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 17, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 18), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 18, TaskName = "Beta Testing", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 19, TaskName = "Disseminate completed product", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 20, TaskName = "Obtain feedback", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 21, TaskName = "Modify", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 22, TaskName = "Test", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 23, TaskName = "Complete", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 24, TaskName = "Post-Project Review", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 18), Progress = 40d, });
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 25, TaskName = "Finalize cost analysis", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 26, TaskName = "Analyze performance", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 27, TaskName = "Archive files", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 28, TaskName = "Document lessons learned", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 18), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 29, TaskName = "Distribute to team members", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 30, TaskName = "Post-project review complete", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+
+ taskDetails[0].Resources = new ObservableCollection() { new Resource { ID = 1, Name = "John" }, new Resource { ID = 2, Name = "Neil" } };
+ taskDetails[0].Child[3].Resources = new ObservableCollection() { new Resource() { ID = 3, Name = "Peter" } };
+ taskDetails[1].Resources = new ObservableCollection() { new Resource() { ID = 4, Name = "David" } };
+
+ taskDetails[0].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 2, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[0].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 3, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[0].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 3, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[1].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 9, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[1].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 10, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[1].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 7, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[2].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+ taskDetails[2].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+ taskDetails[2].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+
+ taskDetails[3].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 18, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[3].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 18, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[3].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 19, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[4].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 25, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 28, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 30, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[4].Predecessor.Add(new Predecessor() { GanttTaskIndex = 27, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ return taskDetails;
+ }
+}
-{% endhighlight %}
+{% endhighlight %}
+{% endtabs %}
#### Output
The following screenshot illustrates how to render the regular strip lines.
-
+
Strip lines in the Gantt chart
{:.caption}
#### Absolute Strip lines
-The following code sample demonstrates how to define a collection of absolute strip lines.
+The following code sample demonstrates how to bind the absolute strip line collection to strip lines.
-{% highlight c# %}
+{% tabs %}
+{% highlight xaml %}
+
+
+
+
+
+
+
+
-StripCollection = new List();
+{% endhighlight %}
+
+{% highlight c# %}
+
+this.ganttControl.ItemsSource = new ViewModel().TaskCollection;
+this.ganttControl.ShowStripLines = true;
+
+// Task attribute mapping
+TaskAttributeMapping taskAttributeMapping = new TaskAttributeMapping();
+taskAttributeMapping.TaskIdMapping = "TaskId";
+taskAttributeMapping.TaskNameMapping = "TaskName";
+taskAttributeMapping.StartDateMapping = "StartDate";
+taskAttributeMapping.ChildMapping = "Child";
+taskAttributeMapping.FinishDateMapping = "FinishDate";
+taskAttributeMapping.DurationMapping = "Duration";
+taskAttributeMapping.MileStoneMapping = "IsMileStone";
+taskAttributeMapping.PredecessorMapping = "Predecessor";
+taskAttributeMapping.ProgressMapping = "Progress";
+taskAttributeMapping.ResourceInfoMapping = "Resource";
+this.ganttControl.TaskAttributeMapping = taskAttributeMapping;
+
+List stripCollection = new List();
//Getting the collection of StripLineInfo
-StripCollection = GetStripCollection();
+stripCollection = GetStripCollection();
+
+//Property for strip collection.
+public List StripCollection
+{
+ get
+ {
+ return this.stripCollection;
+ }
+ set
+ {
+ this.stripCollection = value;
+ RaisePropertyChanged("StripCollection");
+ }
+}
//Method will return the collection StripLineInfo
private List GetStripCollection()
-
{
- List stripCollection = new List();
- stripCollection.Add(new StripLineInfo()
- {
- Type = StriplineType.Absolute,
- Height = 1500,
- Width = 200,
- Position = new System.Windows.Point(300, 5),
- Background = new SolidColorBrush(Colors.LightGray)
+ this.stripCollection.Add(new StripLineInfo()
+ {
+ Content = "Weekly Team Meeting",
+ StartDate = new DateTime(2012, 6, 4),
+ EndDate = new DateTime(2012, 6, 4),
+ HorizontalContentAlignment = HorizontalAlignment.Center,
+ VerticalContentAlignment = VerticalAlignment.Center,
+ Background = Brushes.Gold, RepeatBehavior = Repeat.Week, RepeatFor = 1,
+ RepeatUpto = new DateTime(2012, 12, 10),
});
- return stripCollection;
-}
+ return this.stripCollection;
+}
{% endhighlight %}
-The following code sample demonstrates how to bind the absolute strip line collection to strip lines.
+{% highlight c# tabtitle="ViewModel.cs" %}
-{% highlight xaml %}
+ public class ViewModel
+ {
+ ///
+ /// Holds the task collections.
+ ///
+ private ObservableCollection taskCollections;
-
-
-
-
-
-
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ViewModel()
+ {
+ this.taskCollections = GetData();
+ }
+
+ ///
+ /// Gets or sets the appointment item source.
+ ///
+ /// The appointment item source.
+ public ObservableCollection TaskCollection
+ {
+ get
+ {
+ return this.taskCollections;
+ }
+ set
+ {
+ this.taskCollections = value;
+ }
+ }
+
+ ///
+ /// Gets the data.
+ ///
+ /// The task details
+ public ObservableCollection GetData()
+ {
+ var taskDetails = new ObservableCollection();
+
+ taskDetails.Add(new TaskDetails() { TaskId = 1, TaskName = "Analysis/Planning", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 2, TaskName = "Identify Components to be Localized", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 3, TaskName = "Ensure file localizability", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 4, TaskName = "Identify tools", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 5, TaskName = "Test tools", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 8, 1), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 6, TaskName = "Develop delivery timeline", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 8, 1), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 7, TaskName = "Analysis Complete", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 8, 10), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 8, TaskName = "Production", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 9, TaskName = "Software Components", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 10, TaskName = "Localization Component - User Interface", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 11, TaskName = "User Assistance Components", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 12, TaskName = "Software components complete", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 13, TaskName = "Quality Assurance", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 12), Progress = 40d, });
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 14, TaskName = "Review project information", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 15), Progress = 20d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 15, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 8), Progress = 20d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 16, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 17, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 18), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 18, TaskName = "Beta Testing", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 19, TaskName = "Disseminate completed product", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 20, TaskName = "Obtain feedback", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 21, TaskName = "Modify", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 22, TaskName = "Test", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 23, TaskName = "Complete", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 24, TaskName = "Post-Project Review", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 18), Progress = 40d, });
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 25, TaskName = "Finalize cost analysis", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 26, TaskName = "Analyze performance", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 27, TaskName = "Archive files", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 28, TaskName = "Document lessons learned", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 18), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 29, TaskName = "Distribute to team members", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 30, TaskName = "Post-project review complete", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+
+ taskDetails[0].Resources = new ObservableCollection() { new Resource { ID = 1, Name = "John" }, new Resource { ID = 2, Name = "Neil" } };
+ taskDetails[0].Child[3].Resources = new ObservableCollection() { new Resource() { ID = 3, Name = "Peter" } };
+ taskDetails[1].Resources = new ObservableCollection() { new Resource() { ID = 4, Name = "David" } };
+
+ taskDetails[0].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 2, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[0].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 3, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[0].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 3, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[1].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 9, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[1].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 10, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[1].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 7, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[2].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+ taskDetails[2].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+ taskDetails[2].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+
+ taskDetails[3].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 18, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[3].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 18, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[3].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 19, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[4].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 25, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 28, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 30, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[4].Predecessor.Add(new Predecessor() { GanttTaskIndex = 27, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ return taskDetails;
+ }
+}
{% endhighlight %}
+{% endtabs %}
#### Output
The following screenshot illustrates how to render the absolute strip lines.
-
-
+
Strip lines in the Gantt chart
{:.caption}
diff --git a/wpf/Gantt/zooming.md b/wpf/Gantt/zooming.md
index c1405853ae..d08f2ed900 100644
--- a/wpf/Gantt/zooming.md
+++ b/wpf/Gantt/zooming.md
@@ -33,36 +33,193 @@ To add the built-in zooming:
{% tabs %}
{% highlight xaml %}
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{% endhighlight %}
-{% highlight c# %}
-/// Defining the Slider
-Slider slider = new Slider();
-slider.Minimum = 1;
-slider.Minimum = 600;
+{% highlight c# %}
-//Hooking the value changed event of the slider
-slider.ValueChanged += slider_ValueChanged;
+this.ganttControl.ItemsSource = new ViewModel().TaskCollection;
+this.ganttControl.UseOnDemandSchedule = true;
+
+// Task attribute mapping
+TaskAttributeMapping taskAttributeMapping = new TaskAttributeMapping();
+taskAttributeMapping.TaskIdMapping = "TaskId";
+taskAttributeMapping.TaskNameMapping = "TaskName";
+taskAttributeMapping.StartDateMapping = "StartDate";
+taskAttributeMapping.ChildMapping = "Child";
+taskAttributeMapping.FinishDateMapping = "FinishDate";
+taskAttributeMapping.DurationMapping = "Duration";
+taskAttributeMapping.MileStoneMapping = "IsMileStone";
+taskAttributeMapping.PredecessorMapping = "Predecessor";
+taskAttributeMapping.ProgressMapping = "Progress";
+taskAttributeMapping.ResourceInfoMapping = "Resource";
+this.ganttControl.TaskAttributeMapping = taskAttributeMapping;
+
+/// Defining the Slider
+Slider slider = new Slider();
+slider.Minimum = 1;
+slider.Minimum = 600;
+
+//Hooking the value changed event of the slider
+slider.ValueChanged += OnSliderValueChanged;
+
+///
+/// Handles the ValueChanged event of the slider control.
+///
+void OnSliderValueChanged(object sender, RoutedPropertyChangedEventArgs e)
+{
+ //Changing the value of zoom factor
+ this.Gantt.ZoomFactor = (sender as Slider).Value;
+}
-//Defining the Gantt
-GanttControl Gantt = new GanttControl();
-Gantt.ItemsSource = view.GanttItemSource;
-Gantt.UseOnDemandSchedule = true;
+{% endhighlight %}
-///
-/// Handles the ValueChanged event of the slider control.
-///
-void slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
-{
- //Changing the value of zoom factor
- this.Gantt.ZoomFactor = (sender as Slider).Value;
+{% highlight c# tabtitle="ViewModel.cs" %}
+
+ public class ViewModel
+ {
+ ///
+ /// Holds the task collections.
+ ///
+ private ObservableCollection taskCollections;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ViewModel()
+ {
+ this.taskCollections = GetData();
+ }
+
+ ///
+ /// Gets or sets the appointment item source.
+ ///
+ /// The appointment item source.
+ public ObservableCollection TaskCollection
+ {
+ get
+ {
+ return this.taskCollections;
+ }
+ set
+ {
+ this.taskCollections = value;
+ }
+ }
+
+ ///
+ /// Gets the data.
+ ///
+ /// The task details
+ public ObservableCollection GetData()
+ {
+ var taskDetails = new ObservableCollection();
+
+ taskDetails.Add(new TaskDetails() { TaskId = 1, TaskName = "Analysis/Planning", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 2, TaskName = "Identify Components to be Localized", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 3, TaskName = "Ensure file localizability", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 4, TaskName = "Identify tools", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 5, TaskName = "Test tools", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 8, 1), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 6, TaskName = "Develop delivery timeline", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 8, 1), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 7, TaskName = "Analysis Complete", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 8, 10), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 8, TaskName = "Production", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 9, TaskName = "Software Components", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 10, TaskName = "Localization Component - User Interface", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 11, TaskName = "User Assistance Components", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 12, TaskName = "Software components complete", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 13, TaskName = "Quality Assurance", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 12), Progress = 40d, });
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 14, TaskName = "Review project information", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 15), Progress = 20d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 15, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 8), Progress = 20d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 16, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 17, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 18), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 18, TaskName = "Beta Testing", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 19, TaskName = "Disseminate completed product", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 20, TaskName = "Obtain feedback", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 21, TaskName = "Modify", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 22, TaskName = "Test", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 23, TaskName = "Complete", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 24, TaskName = "Post-Project Review", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 18), Progress = 40d, });
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 25, TaskName = "Finalize cost analysis", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 26, TaskName = "Analyze performance", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 27, TaskName = "Archive files", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 28, TaskName = "Document lessons learned", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 18), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 29, TaskName = "Distribute to team members", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 30, TaskName = "Post-project review complete", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+
+ taskDetails[0].Resources = new ObservableCollection() { new Resource { ID = 1, Name = "John" }, new Resource { ID = 2, Name = "Neil" } };
+ taskDetails[0].Child[3].Resources = new ObservableCollection() { new Resource() { ID = 3, Name = "Peter" } };
+ taskDetails[1].Resources = new ObservableCollection() { new Resource() { ID = 4, Name = "David" } };
+
+ taskDetails[0].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 2, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[0].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 3, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[0].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 3, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[1].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 9, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[1].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 10, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[1].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 7, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[2].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+ taskDetails[2].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+ taskDetails[2].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+
+ taskDetails[3].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 18, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[3].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 18, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[3].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 19, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[4].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 25, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 28, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 30, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[4].Predecessor.Add(new Predecessor() { GanttTaskIndex = 27, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ return taskDetails;
+ }
}
{% endhighlight %}
@@ -72,7 +229,7 @@ void slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{% endhighlight %}
{% highlight c# %}
-/// APIs in View Model.
+this.ganttControl.ItemsSource = new ViewModel().TaskCollection;
+this.ganttControl.UseOnDemandSchedule = true;
+
+// Task attribute mapping
+TaskAttributeMapping taskAttributeMapping = new TaskAttributeMapping();
+taskAttributeMapping.TaskIdMapping = "TaskId";
+taskAttributeMapping.TaskNameMapping = "TaskName";
+taskAttributeMapping.StartDateMapping = "StartDate";
+taskAttributeMapping.ChildMapping = "Child";
+taskAttributeMapping.FinishDateMapping = "FinishDate";
+taskAttributeMapping.DurationMapping = "Duration";
+taskAttributeMapping.MileStoneMapping = "IsMileStone";
+taskAttributeMapping.PredecessorMapping = "Predecessor";
+taskAttributeMapping.ProgressMapping = "Progress";
+taskAttributeMapping.ResourceInfoMapping = "Resource";
+this.ganttControl.TaskAttributeMapping = taskAttributeMapping;
+
private List _zoomFactors = new List { 100d, 200d, 300d, 400d, 600d, 800d, 1000d };
///
@@ -167,7 +372,7 @@ public double ZoomFactor
///
/// The source of the event.
/// The instance containing the event data.
-private void Gantt_ZoomChanged(object sender, ZoomChangedEventArgs args)
+private void OnGanttZoomChanged(object sender, ZoomChangedEventArgs args)
{
if (args.ZoomFactor == 100)
{
@@ -230,13 +435,119 @@ private void Gantt_ZoomChanged(object sender, ZoomChangedEventArgs args)
}
{% endhighlight %}
+
+{% highlight c# tabtitle="ViewModel.cs" %}
+
+ public class ViewModel
+ {
+ ///
+ /// Holds the task collections.
+ ///
+ private ObservableCollection taskCollections;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ViewModel()
+ {
+ this.taskCollections = GetData();
+ }
+
+ ///
+ /// Gets or sets the appointment item source.
+ ///
+ /// The appointment item source.
+ public ObservableCollection TaskCollection
+ {
+ get
+ {
+ return this.taskCollections;
+ }
+ set
+ {
+ this.taskCollections = value;
+ }
+ }
+
+ ///
+ /// Gets the data.
+ ///
+ /// The task details
+ public ObservableCollection GetData()
+ {
+ var taskDetails = new ObservableCollection();
+
+ taskDetails.Add(new TaskDetails() { TaskId = 1, TaskName = "Analysis/Planning", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 2, TaskName = "Identify Components to be Localized", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 3, TaskName = "Ensure file localizability", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 4, TaskName = "Identify tools", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 5, TaskName = "Test tools", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 8, 1), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 6, TaskName = "Develop delivery timeline", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 8, 1), Progress = 10d }));
+ taskDetails[0].Child.Add((new TaskDetails() { TaskId = 7, TaskName = "Analysis Complete", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 8, 10), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 8, TaskName = "Production", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 9, TaskName = "Software Components", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 10, TaskName = "Localization Component - User Interface", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 11, TaskName = "User Assistance Components", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[1].Child.Add((new TaskDetails() { TaskId = 12, TaskName = "Software components complete", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 13, TaskName = "Quality Assurance", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 12), Progress = 40d, });
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 14, TaskName = "Review project information", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 15), Progress = 20d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 15, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 8), Progress = 20d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 16, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[2].Child.Add((new TaskDetails() { TaskId = 17, TaskName = "Localization Component", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 18), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 18, TaskName = "Beta Testing", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 14), Progress = 40d });
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 19, TaskName = "Disseminate completed product", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 20, TaskName = "Obtain feedback", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 21, TaskName = "Modify", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 22, TaskName = "Test", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+ taskDetails[3].Child.Add((new TaskDetails() { TaskId = 23, TaskName = "Complete", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 19), Progress = 10d }));
+
+ taskDetails.Add(new TaskDetails() { TaskId = 24, TaskName = "Post-Project Review", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 18), Progress = 40d, });
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 25, TaskName = "Finalize cost analysis", StartDate = new DateTime(2011, 7, 3), FinishDate = new DateTime(2011, 7, 5), Progress = 20d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 26, TaskName = "Analyze performance", StartDate = new DateTime(2011, 7, 6), FinishDate = new DateTime(2011, 7, 7), Progress = 20d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 27, TaskName = "Archive files", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 28, TaskName = "Document lessons learned", StartDate = new DateTime(2011, 7, 14), FinishDate = new DateTime(2011, 7, 18), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 29, TaskName = "Distribute to team members", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+ taskDetails[4].Child.Add((new TaskDetails() { TaskId = 30, TaskName = "Post-project review complete", StartDate = new DateTime(2011, 7, 10), FinishDate = new DateTime(2011, 7, 14), Progress = 10d }));
+
+ taskDetails[0].Resources = new ObservableCollection() { new Resource { ID = 1, Name = "John" }, new Resource { ID = 2, Name = "Neil" } };
+ taskDetails[0].Child[3].Resources = new ObservableCollection() { new Resource() { ID = 3, Name = "Peter" } };
+ taskDetails[1].Resources = new ObservableCollection() { new Resource() { ID = 4, Name = "David" } };
+
+ taskDetails[0].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 2, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[0].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 3, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[0].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 3, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[1].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 9, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[1].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 10, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[1].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 7, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[2].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+ taskDetails[2].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+ taskDetails[2].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 12, GanttTaskRelationship = GanttTaskRelationship.FinishToFinish });
+
+ taskDetails[3].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 18, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[3].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 18, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[3].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 19, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+
+ taskDetails[4].Child[1].Predecessor.Add(new Predecessor() { GanttTaskIndex = 25, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[2].Predecessor.Add(new Predecessor() { GanttTaskIndex = 28, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[3].Predecessor.Add(new Predecessor() { GanttTaskIndex = 30, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ taskDetails[4].Child[4].Predecessor.Add(new Predecessor() { GanttTaskIndex = 27, GanttTaskRelationship = GanttTaskRelationship.StartToStart });
+ return taskDetails;
+ }
+}
+
+{% endhighlight %}
{% endtabs %}
{% endcapture %}
{{ codesnippet2 | OrderList_Indent_Level_1 }}
The following image shows Custom Zooming in Gantt:
-
+
#### Samples Link
diff --git a/wpf/Release-notes/v26.1.39.md b/wpf/Release-notes/v26.1.39.md
new file mode 100644
index 0000000000..0dccfebeea
--- /dev/null
+++ b/wpf/Release-notes/v26.1.39.md
@@ -0,0 +1,16 @@
+---
+title: Essential Studio for WPF Weekly Nuget Release Release Notes
+description: Essential Studio for WPF Weekly Nuget Release Release Notes
+platform: WPF
+documentation: ug
+---
+
+# Essential Studio for WPF Release Notes
+
+{% include release-info.html date="June 25, 2024" version="v26.1.39" %}
+
+{% directory path: _includes/release-notes/v26.1.39 %}
+
+{% include {{file.url}} %}
+
+{% enddirectory %}
\ No newline at end of file
diff --git a/wpf/Surface-Chart/Overview.md b/wpf/Surface-Chart/Overview.md
index da0e587479..143487fb08 100644
--- a/wpf/Surface-Chart/Overview.md
+++ b/wpf/Surface-Chart/Overview.md
@@ -1,7 +1,7 @@
---
layout: post
-title: About WPF Surface Chart control | Syncfusion
-description: Learn here all about introduction of Syncfusion WPF Surface Chart (SfSurfaceChart) control, its elements and more.
+title: Overview of WPF Surface Chart Control | Syncfusion
+description: Learn here all about overview of Syncfusion WPF Surface Chart (SfSurfaceChart) control, it's elements, and more.
platform: wpf
control: SfSurfaceChart
documentation: ug
@@ -11,7 +11,7 @@ documentation: ug
Essential Surface Chart shows a three-dimensional surface that connects a set of data points.
-
+
## Key Feature of Surface Chart
diff --git a/wpf/Surface-Chart/surface_chart_images/surface_chart_img1.jpeg b/wpf/Surface-Chart/surface_chart_images/wpf-surface-chart-overview.jpeg
similarity index 100%
rename from wpf/Surface-Chart/surface_chart_images/surface_chart_img1.jpeg
rename to wpf/Surface-Chart/surface_chart_images/wpf-surface-chart-overview.jpeg
|