Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Show (and calculate) only full days
posted

I'm just evaluating the XamGant control and have the requirement to only show full days without working hours.
The calculation of the duration should calculate without working hours as well.

Is the a feature to ignore the time value of the StartDate and EndDate Properties or do I have to do these calculations on my own?

Is there a possibility to change the Tolltip of Tasks to only show the date part?

Is there a possibility to move the task slider only by full days?

2016-02-08 14_33_49-ZAS für Wohnungsgenossenschaft Glückauf Süd eG - by datom.png
  • 34430
    Verified Answer
    Offline posted

    Hello Harry,

    Thank you for your post.

    Regarding the feature to ignore time values of the StartDate and EndDate properties, there doesn't really exist a property in the XamGantt that will do this for you. However, there does exist a ManualDuration property on the ProjectTask class that you can set to a ProjectDuration object via the static methods on the ProjectDuration class. For example, if you were looking to simply set the duration of one of your tasks to be 3 days, you could set the ManualDuration property to ProjectDuration.FromFormatUnits(3, ProjectDurationFormat.Days);.

    To change the tooltip of your tasks to only show the date part, you can set a new ProjectSettings object to your Project's Settings property. These ProjectSettings elements have a property named DateStringFormat that the tooltips draw from. By setting this date string format, you can determine how the dates will show up both in the XamGantt and in the tooltips for your tasks. I see from your original post, though, that you are looking to have the time part of the tooltip set to 00:00, though. To achieve this, I would recommend that you modify the default template for the tooltip presenters used in the XamGantt. This default style can be found in the generic.shared.xaml file commonly found at the following directory: C:\Program Files (x86)\Infragistics\<your version here>\WPF\DefaultStyles\Gantt. Each type of task presenter has its own tooltip presenter, so you will want to find the ones that correspond to your task type, include them, and then modify them in the XAML of your application to include the 00:00 part of your desired template.

    I have attached a sample project to demonstrate the above procedures.

    Regarding the task slider moving only by days, I am assuming that you are referring to the slider used to resize the tasks in your XamGantt chart. Please let me know if this impression is incorrect, as the following goes off of it. The amount that the tasks are rounded to when they are resized is calculated internally, and cannot be directly changed. It is based on the smallest units(minutes, hours, or days) of the task. There may be a way that you can force this behavior though, by handling the XamGantt's TaskBarDragging event and modifying the NewDateTime property of the event arguments of the corresponding handler for that event. You will also want to check the event arguments' DragOperation property as well, as this will tell you which type of drag is being performed. In your case, it appears you will likely want to check for the ResizeTask operation.

    I hope this helps you. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XamGanttDaysOnlyCase.zip