February 22, 2020, 10:05:50 AM

See more Support incidents in our old archived forum.

Recent Posts

Pages: [1] 2 3 ... 10
1
WPF Gantt Package / Re: Moving a task collapses it when RoundToOptions is set to Day
« Last post by Rajagopal on February 21, 2020, 03:33:33 PM »
Jan,

We will take a look into it and get back to you soon.

Thanks,
Raja.
2
WPF Gantt Package / Moving a task collapses it when RoundToOptions is set to Day
« Last post by jan.reker on February 20, 2020, 01:06:33 PM »
Hello,

we have a TaskItem with properties that bind to start and end time.
In the setter of end time we try to retain the original duration after moving a task.
A task is allowed get longer as a result of RoundToOptions, but is not allowed to shrink.
UpdateEndTimeOnMove is default true, because it is needed for resizing (not included in this example).

Code: [Select]
public class TaskItem : BindableBase
    {

        /// <summary>
        /// Used to temporarly store duration of task while moving it.
        /// </summary>
        public TimeSpan? _TaskTimeSpanOld;

        public DateTime? _StartTime;
        public DateTime? _EndTime;

        public DateTime? StartTime
        {
            get { return _StartTime; }
            set
            {
                _TaskTimeSpanOld = EndTime - StartTime;
                SetProperty<DateTime?>(ref _StartTime, value);
            }
        }

        public DateTime? EndTime
        {
            get { return _EndTime; }
            set
            {
                //umcomment this: Task item will have correct duration of 9 hours after moving, but item will be displayed with duration 0.
                //Moving item again to another day will display correct duration again.
                //if (value == this.StartTime && _TaskTimeSpanOld == null)
                //    _TaskTimeSpanOld = EndTime - StartTime;

                if (_TaskTimeSpanOld != null)
                {
                    TimeSpan? taskTimeSpanNew = value - StartTime;
                    //keep original length if item would shrink
                    if (taskTimeSpanNew != null && taskTimeSpanNew < _TaskTimeSpanOld)
                    {
                        long differenceInTicks = (((TimeSpan)_TaskTimeSpanOld) - ((TimeSpan)taskTimeSpanNew)).Ticks;

                        // Reset before StartTime is changed
                        _TaskTimeSpanOld = null;
                        value = ((DateTime)value).AddTicks(differenceInTicks);
                    }
                }
                SetProperty<DateTime?>(ref _EndTime, value);
            }
        }

        public string Name { get; set; }
    }

These conditions must be met:
Task with duration <= 12 hours
Start Time of task == 00:00
RoundToOptions is set to "Day" (no issues with the other options)
Move task to 1 day prior but not far enough, that it actually snaps to 00:00 of the previous day.


Result:
Task stays on the same day, but end time is also set to 00:00 of the same day.
It collapsed to 0 hours duration.


Apparently this is the result of the RoundTime() method. It is only rounded up, if the duration is > 12.
It returns just the date part of the proposed end DateTime, so the time is lost.

Code: [Select]
case RoundToOptions.Day:
    if (dateTime.Date < dateTime && dateTime.Hour > 12)
        return dateTime.Date + TimeSpan.FromDays(1);
    else
        return dateTime.Date;

Moving the task again, the duration stays like this.

I tried to check for this condition and set end time with the original time (see commented code in EndTime.Setter).
Internally the end time is 09:00 (as seen in the StartTime.Setter in debug mode) but the task is still displayed as 00:00.
Only after moving the task to another day, the time of 09:00 is displayed correctly.



How can I keep the duration of the task after moving?
Version 8.0.45.9

Jan
3
WPF Gantt Package / Re: FGWorkingHoursBar problem
« Last post by Rajagopal on February 18, 2020, 04:06:48 PM »
Francesco,

We have sent the reference sample from our support mail to reproduce the issue as we couldn’t. Please get it and help us reproduce the issue.

Thanks,
Raja.
4
WPF Gantt Package / FGWorkingHoursBar problem
« Last post by Francesco Fantoni on February 17, 2020, 06:59:18 PM »
Hi,
I'm facing with a problem regarding FGWorkingHoursBar : when you zoom in the NonWorkingHoursBar start to shift or cutoff.
I have attacched a gif image where you can see that. Blue bar are Working hours and Violet bar ara NonWorking Hours; all items are with WotkingTimeScheduler.24x5. At the beginning violet bars overlap the gray background on saturdays and sundays; when you start to zoom in all is ok and violet bars are rendered correctly but suddenly they start to shift or move.

(It's a Gif Image Click to view the animation)

I have set this fxgantt properties:
    this.fxgantt.ApplyBarWidthOptimization = false;
    this.fxgantt.SyncRowBackgrounds = true;
    this.fxgantt.UseChartVirtualization = true;

and Gantt version 8.0.
Thanks in advance
Francesco
5
WPF Gantt Package / Re: Refresh FlexyGantt
« Last post by ForumAdmin on November 18, 2019, 11:04:19 PM »
Francesco,

Thanks for the update. Yes, it appears that resetting the ItemsSource might be a cleaner solution.

We will update you if we come across a better way to do this.

Regards,
Praveen
6
WPF Gantt Package / Re: Refresh FlexyGantt
« Last post by Francesco Fantoni on November 17, 2019, 05:11:47 PM »
Thanks for your advice but I don't get any improvements: the time the gantt takes to "refresh bindings" is the same as it takes if I use ItemSource property. This is because maybe the time that the gantt takes to "refresh" is due mainly to the rendering process, right? I'm afraid there is no solution. If you have other suggestions they'll be appreciated and if you plan to do some improvements in the rendering process in the future, I'll be happy to test and give you feedback.
Thanks
Francesco
7
WPF Gantt Package / Re: Refresh FlexyGantt
« Last post by Rajagopal on November 08, 2019, 01:43:24 PM »
Here is a way to update the bindings in specific controls on an event like button click, in our task bars. You could use this approach on other controls' bindings, besides our task bars as well:

Code: [Select]
public void RefreshBindings(DependencyObject element, bool recurse)
{
if (element == null)
{
throw new ArgumentNullException("element");
}

foreach (PropertyDescriptor pd in TypeDescriptor.GetProperties(element,
new Attribute[] { new PropertyFilterAttribute(PropertyFilterOptions.All) }))
{
DependencyPropertyDescriptor dpd =
DependencyPropertyDescriptor.FromProperty(pd);

if (dpd != null)
{
if (BindingOperations.IsDataBound(element, dpd.DependencyProperty))
{
BindingOperations.GetBindingExpression(element, dpd.DependencyProperty).UpdateTarget();
}
}
}

if (recurse)
{
List<FrameworkElement> Children = new List<FrameworkElement>();
Extensions.GetChildren<FrameworkElement>(element, ref Children, true, false);

foreach (FrameworkElement item in Children)
{
RefreshBindings(item, false);
}
}
}
8
WPF Gantt Package / Re: Refresh FlexyGantt
« Last post by Rajagopal on November 07, 2019, 06:44:20 AM »
Francesco,

Refreshing the view in WPF controls are not straight forward. We are looking for a best solution, will update you soon.

Thanks
Raja
9
WPF Gantt Package / Re: Refresh FlexyGantt
« Last post by Francesco Fantoni on November 02, 2019, 07:43:15 PM »
Hi,
I apologize for late reply. I need to refresh the gantt when changing the graphical render of each task even the collection data remains the same. In my project there are lot of case, for example, if I want to switch from a color palette to another one, or if I need to show other information inside each box. Resetting the datasource takes some time, instead, in these cases, I'd like to have a faster way to render again the FlexyGantt. If the collection data changes then I obviously use datasource property.
Thanks for your support
Francesco
10
jQuery Gantt Package / Re: Save to XML issue
« Last post by Rajagopal on October 24, 2019, 03:22:58 PM »
Hi Dniezgoda,

Yes you are right. The external utility file "Json2Xml.js" which we used to convert the json to xml has this issue. It's failed to convert "&" string as valid corresponding xml "&amp;" string. We have fixed it and sent the fix to your e-mail. Please get it and let us know the status. Thank you for your patience.


Thanks
Raja
Pages: [1] 2 3 ... 10