October 31, 2020, 01:23:35 AM

See more Support incidents in our old archived forum.

Author Topic: InvalidOperationException when using Ctrl key in GanttChart with .Net 4.0  (Read 4930 times)

d.laumaille

  • Customers
  • Newbie
  • *
  • Posts: 21
Hi to all of us !

I've got a problem with GanttControl, using .Net 4.0 : when pressing the Ctrl Key while clicking in GanttChart, this message appear :
Quote
System.InvalidOperationException: Can only change SelectedItems collection in multiple selection modes. Use SelectedItem in single select modes.

And the stack trace shows this :
Code: [Select]
    System.Windows.Controls.Primitives.Selector.OnSelectedItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
    System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
    System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
    System.Windows.Controls.SelectedItemCollection.InsertItem(Int32 index, Object item)
    System.Collections.ObjectModel.Collection`1.Add(T item)
    System.Collections.ObjectModel.Collection`1.System.Collections.IList.Add(Object value)
    RadiantQ.Windows.Controls.Gantt.GanttControl.SelectItem(Object item)
    RadiantQ.Windows.Controls.Gantt.View.GanttTaskItemBar.DepConnectorThumb_DragStarted(Object sender, DragStartedEventArgs e)
    System.Windows.Controls.Primitives.DragStartedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
    System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
    System.Windows.Controls.Primitives.Thumb.OnMouseLeftButtonDown(MouseButtonEventArgs e)
    System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)
    System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
    System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
    System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
    System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
    System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
    System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
    System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
    System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
    System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
    System.Windows.Input.InputManager.ProcessStagingArea()
    System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
    System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
    System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
    System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    System.Windows.Forms.Application.Run(Form mainForm)
    Ag2l.Solutions.Forms.Program.Main() dans q:\Industria.Net\SQLSRV02\Root\Systeme\ExplorerApplication\Program.cs:ligne 70

I have tested this on your sample project (CustomGanttLook for example) : it does the same in 4.0, but it works in 4.5...
Is it a bug ? Is there any workaround ?
I know my users don't have to do this, but they could do it anyway...

Please help ! ^^

Rajagopal

  • RQ Members
  • Full Member
  • *
  • Posts: 149
laumaille,

We are looking on this, will update you soon.


Thanks,
Raja

ForumAdmin

  • Administrator
  • Jr. Member
  • *****
  • Posts: 89
Hi,

We have now fixed this issue. Do you need a new version right away or can you wait until the official release in August?

Thanks
RQ Support

d.laumaille

  • Customers
  • Newbie
  • *
  • Posts: 21
Hi,

That was fast !

If I could have a new version now it would be cool ! I'll be on vacation in August so the project wouldn't be fixed untill September...

Thanks

ForumAdmin

  • Administrator
  • Jr. Member
  • *****
  • Posts: 89
We just sent you an assembly that fixes both these issues. Please confirm.

Thanks
RQ Support

d.laumaille

  • Customers
  • Newbie
  • *
  • Posts: 21
Hi,

Sorry for the delay, I was on another project.

Thanks for the new library, but it seems a little buggy...

I'm using a flexyGantt with ganttControl model, using ResourceToActivitiesListConverter.
And in this case, the flexyGantt doesn't seem to react good when I affect its ItemsSource property : I've got an exception in the FlexyTreeViewItem constructor, cause the parent passed is null !

Here is the stack trace :
Code: [Select]
    RadiantQ.Windows.Controls.FlexyGantt.FlexyTreeViewItem..ctor(FlexyTree parent, FlexyTreeViewItem parentItem, Int32 level)
    RadiantQ.Windows.Controls.FlexyGantt.FlatListDataConnection.OnAddItem(Object item, Int32 index)
    RadiantQ.Windows.Controls.FlexyGantt.FlatListDataConnection.UpdateList()
    RadiantQ.Windows.Controls.FlexyGantt.FlatListDataConnection..ctor(IEnumerable flatListsource, FlatItemsSourceList destList)
    RadiantQ.Windows.Controls.FlexyGantt.FlexyTree.OnItemsSourceTempChanged()
    RadiantQ.Windows.Controls.FlexyGantt.FlexyTree.ItemsSourceTempChanged(DependencyObject source, DependencyPropertyChangedEventArgs args)
    System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
    System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
    System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
    System.Windows.StyleHelper.InvalidateDependents(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, FrugalStructList`1& dependents, Boolean invalidateOnlyContainer)
    System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, DependencyPropertyChangedEventArgs changedArgs, Boolean invalidateOnlyContainer, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalMap& propertyTriggersWithActions, Int32 sourceChildIndex)
    System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
    System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
    System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
    System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
    System.Windows.Controls.ItemsControl.set_ItemsSource(IEnumerable value)
    Ag2l.Solutions.Controls.WinUI.Planning.New.WpfGantt.LoadDatasResources() dans q:\Industria.Net\SQLSRV02\Root\Systeme\Planning\New\WpfGantt.xaml.cs:ligne 209

Could you fix this ?

Thanks in advance...

ForumAdmin

  • Administrator
  • Jr. Member
  • *****
  • Posts: 89
David, we just sent you an updated .NET 4.0 assembly with a fix for this. Please use it.

RQ Support