Hello,
I am working with xamGantt to reschedule project tasks. By getting started with this control some questions arrised:
1. How can I bind ActiveRow() to the ViewModel? Binding works, but I never receive any change?
2. Is it possible to set the color of each ganttbar individually via binding?
3. Is it possible to filter the columns in the left area of the gantt control?
4. There is a feature request regarding customer columns in the xamGantt - can you please share the status on that one?
5. I am using my own class and mapp it with ListBackedProject to xam Gantt. When I want to write one resource into the field Resources, does it matter if I use a simpe string or a list<>? Which datatype is needed to add subtasks to one tasks - is it IEnumerable?
Thanks in advance
Niko
one additional issue:
6. How can I configure Success and/or Predecessors with my own class and its mapping via ListBackedProject ?
Thanks
Hi,
going further with xamGantt new questions arised:
7. Is there a display format for weeks (according to ISO 8601)?
Hello Niko,
Thank you for your post. I have been investigating into the issues that you have listed, and I have some information for you on them. I will address these issues in the order that they are listed.
1. You are likely not receiving any change notifications, as the XamGantt.ActiveRow property binds OneWay by default. I would recommend that you set the Mode of your binding to “TwoWay” in order to receive change notifications when your ActiveRow changes.
2. In order to change the color of each Gantt bar individually, I would recommend including the default style for “GanttNormalTaskPresenter” and all of its dependencies. This default style and its dependencies exist in the generic.shared.xaml file commonly found at the following directory:
C:\Program Files (x86)\Infragistics\<your version here>\WPF\DefaultStyles\Gantt
Once you include this style and its dependencies, I would recommend that you locate a Grid with its Visibility bound to “{TemplateBinding ComputedMiddleBarVisibility}.” Inside, you will find five Rectangle objects. These Rectangles are the Gantt bars, and if you bind their Fill properties, you can essentially bind the colors of the Gantt bars, individually. I would recommend a binding like the following:
Fill=”{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Task.DataItem.TaskBrush}”
Breaking this binding down, the TemplatedParent would bind up to the GanttNormalTaskPresenter, which has a reference to the underlying ProjectTask that will be created for it. This ProjectTask has a DataItem property which will return the item that you are using for the ListBackedProject mapping, and in this case, that item would have a TaskBrush property of your creation to determine the brush color.
3. Filtering in the XamGantt is intentionally suppressed, as it is only implemented on the columns that are publically accessible, and is not implemented at all on the chart-side of things as the visibility of the rows in the grid versus the chart work completely independent of one another.
There is a slightly hacky way that you can enable filtering, though, and that would be to get the ProjectTableGrid from the XamGantt programmatically and enable filtering on it. An operation like this could look like the following:
//In perhaps, the Loaded event of the XamGantt…XamGantt gantt = sender as XamGantt;ProjectTableGrid grid = Utilities.GetDescendantFromType(gantt, typeof(ProjectTableGrid), false) as ProjectTableGrid;grid.FilteringSettings.AllowFiltering = Infragistics.Controls.Grids.FilterUIType.FilterMenu;
Again though, keep in mind that the filtering will have no effect on the chart-side of the XamGantt, and will only work for certain columns, and so I would personally recommend against this operation.
4. I imagine the product idea that you are referring to is this one: http://ideas.infragistics.com/forums/192363-wpf/suggestions/3601698-support-custom-columns-to-the-xamgantt. If so, this product idea is still in an “Awaiting Votes” stage, and has not begun development. As part of the Infragistics community, I would recommend that if you would like to see this feature implemented in a future version, that you vote on it or comment on it to see if our product management team has more information for you.
5. In order to add Resources and sub tasks to the XamGantt, you will need to map the Resources and Tasks properties with your own string property. In this string property, you can add the Resources and sub-tasks as a comma separated string. For the sub-tasks, the comma-separated string values that you enter need to match the properties that you map to the DataItemId property of the underlying ProjectTask for your ListBackedProject.
6. Like in question 5, the Predecessors also need to be added via comma separated string values. There appears to exist a bug with this, though, in that if the property that you are using for the mapping of the Predecessors property does not implement the INotifyPropertyChanged interface, it will crash when you try to set the Predecessors of a particular task. I have logged this issue in our internal tracking systems, and I have created private support case CAS-181084-X1T2G9 so that you can be linked to this issue. This will allow you to be notified when a fix becomes available for that particular issue so that this interface will not be entirely necessary to set the Predecessors of a task. You can access this support case at https://ko.infragistics.com/my-account/support-activity.
7. It does not appear that the XamGantt supports week format as according to ISO 8601, but you can format the Duration of your tasks by mapping a property of type ProjectDurationFormat to the DurationFormat property of the underlying tasks in your TaskPropertyMappings of your ListBackedProject. This ProjectDurationFormat has an enum value to display the Duration of your task as “Weeks.”
I have attached a sample project to demonstrate the above. I hope this helps you.
Regarding inquiry 3, if you would like to see filtering fully implemented in the XamGantt control in a future version, I would recommend suggesting a new product idea for this feature at http://ideas.infragistics.com. This site will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Hello Andrew,
thanks for the detailed response and the example.
I am working through the list and will come back to you if new question arrises.
some addtional questions came up:
a) Is there a performance difference between using the Infragistics Project and Tasks classes vs. my own classes and bind the via a ListBackedProject ?
b) How can I limit the entry into fields of the grid? Readonly settings works fine. Can I limit the field duration to accept only a range of 0-100 days?