Delay Regrouping Of GanttView

5 posts, 1 answers
  1. Eric
    Eric avatar
    48 posts
    Member since:
    Jul 2012

    Posted 23 Jul 2012 Link to this post

    Hello,

    I have been noticing that the ganttview appears to re-layout itself every time something changes about the child tree.  This seems to be slowing my program down alot (a few seconds to add and subtract a few hundred tasks).  Is there any way to delay or pause this rendering until I have completed manipulating the structure?

    Thanks,
    Eric
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 24 Jul 2012 Link to this post

    Hello Eric,

    What I would suggest you is to set the TasksSource to null, manipulate the structure and set it back again when done. We will be working on this, but currently this is the only way to delay the update.

    Hope this helps.

    All the best,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Eric
    Eric avatar
    48 posts
    Member since:
    Jul 2012

    Posted 24 Jul 2012 Link to this post

    Hello,

    Unfortunately setting taskSource to null results in.... a null reference exception.  Here is the stack trace:

    Thanks,
    Eric

    at Telerik.Windows.Core.EnumerableExtensions.<Select>d__19`1.MoveNext() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Core\Extensions\EnumerableExtensions.cs:line 50
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
    at Telerik.Windows.Core.BatchObservableCollection`1.InsertMany(Int32 startIndex, IEnumerable`1 itemsToAdd) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Core\Utils\Collections\BatchObservableCollection.cs:line 30
    at Telerik.Windows.Core.SynchronizedCollection`1..ctor(IEnumerable sourceCollection, Func`3 wrapFunction) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Core\Utils\Collections\SynchronizedCollection.cs:line 52
    at Telerik.Windows.Core.SynchronizedCollection`1.Create(IEnumerable sourceCollection, Func`3 wrapFunction) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Core\Utils\Collections\SynchronizedCollection.cs:line 36
    at Telerik.Windows.Core.HierarchicalCollectionAdapterBase.ResetSource(IEnumerable source) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Core\Utils\Collections\HierarchicalCollectionAdapter\HierarchicalCollectionAdapterBase.cs:line 126
    at Telerik.Windows.Core.HierarchicalCollectionAdapterBase..ctor(IEnumerable sourceCollection, Boolean isExpandedByDefault) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Core\Utils\Collections\HierarchicalCollectionAdapter\HierarchicalCollectionAdapterBase.cs:line 30
    at Telerik.Windows.Core.HierarchicalCollectionAdapter`1..ctor(IEnumerable`1 hierarchicalItems) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\Scheduling.Core\Scheduling\Core\Utils\Collections\HierarchicalCollectionAdapter\HierarchicalCollectionAdapter.cs:line 11
    at Telerik.Windows.Controls.RadGanttView.ResetGroupingAndDataSource() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\RadGanttView.cs:line 596
    at Telerik.Windows.Controls.RadGanttView.OnTasksSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\RadGanttView.cs:line 478
    at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
    at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
    at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
    at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
    at Telerik.Windows.Controls.RadGanttView.set_TasksSource(IEnumerable`1 value) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\GanttView\GanttView\Gantt\RadGanttView.cs:line 361
    at Microsoft.Office.Engineering.MainWindow.OnMyCommandExecute(Object sender, RoutedEventArgs e) in F:\O15\dev15\toolsrc\buildviz\BuildGui\MainWindow.xaml.cs:line 96
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
    at System.Windows.Controls.Button.OnClick()
    at Telerik.Windows.Controls.RadButton.OnClick() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Buttons\RadButton.cs:line 388
    at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
    at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
    at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
    at System.Windows.Input.InputManager.ProcessStagingArea()
    at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
    at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
    at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    at System.Windows.Application.RunInternal(Window window)
    at System.Windows.Application.Run()
    at Microsoft.Office.Engineering.App.Main() in F:\O15\dev15\toolsrc\buildviz\BuildGui\obj\Debug\App.g.cs:line 0
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
  5. Eric
    Eric avatar
    48 posts
    Member since:
    Jul 2012

    Posted 24 Jul 2012 Link to this post

    Also,

    I don't think setting task source to null will fix the issue.  The issue is that the "Children" data structure which is a SynchronizedCollection class listens to whenever it has changed and does a whole bunch of processing when that happens is the OnSourceCollectionChanged method.  Eventually it gets to call ResetGroupingAndDataSource, which indicates that every single time any Children collection is modified, the layout algorithm is run.  Did I miss something there?

    Thanks,
    Eric
  6. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 25 Jul 2012 Link to this post

    Hi Eric,

    This seems like a bug in the GanttView - thank you for reporting it. I logged it in PITS where you can track its progress there.

    You understood what is happening correctly, but currently this is how the GanttView works. I already added your suggestion for delayed updated and we will work on it as soon as we are able to.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready