DataGridCell Constructor System.ArgumentException

Posted by: random123 on 19 September 2017, 11:07 am EST

  • Posted 19 September 2017, 11:07 am EST

    
    bei C1.WPF.DataGrid.DataGridCell..ctor(DataGridRow row, DataGridColumn column)
       bei C1.WPF.DataGrid.DataGridModel.GetCell(DataGridRow row, DataGridColumn column)
       bei C1.WPF.DataGrid.C1DataGrid.get_Item(DataGridRow row, DataGridColumn column)
       bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.get_CurrentCell()
       bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.ClearCurrentCell(Boolean preserveRow, Boolean preserveColumn)
       bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.ClearCurrentColumn()
       bei C1.WPF.DataGrid.DataGridModel.<.ctor>b__2(Object s, DataGridColumnEventArgs e)
       bei System.EventHandler`1.Invoke(Object sender, TEventArgs e)
       bei C1.WPF.DataGrid.DataGridColumnCollection.OnBeforeRemoveColumn(DataGridColumn column)
       bei C1.WPF.DataGrid.DataGridColumnCollection.ClearAutogeneratedColumns()
       bei C1.WPF.DataGrid.DataGridModel.ClearAutoGeneratedColumns()
       bei C1.WPF.DataGrid.DataGridModel.AutoGenerateColumns()
       bei C1.WPF.DataGrid.DataGridModel.Reload(Boolean createColumns)
       bei C1.WPF.DataGrid.DataGridModel.OnItemsSourceChanged(IEnumerable itemsSource)
       bei C1.WPF.DataGrid.C1DataGrid.OnItemsSourceChanged(IEnumerable oldValue)
       bei C1.WPF.DataGrid.C1DataGrid.OnItemsSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei C1.WPF.DataGrid.C1DataGrid.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
       bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
       bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       bei System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       bei C1.WPF.DataGrid.C1DataGrid.set_ItemsSource(IEnumerable value)
    
    

    “bei” in German means “at” in english

    please fix as soon as possible

  • Posted 19 September 2017, 11:07 am EST

    
    bei C1.WPF.DataGrid.DataGridCell..ctor(DataGridRow row, DataGridColumn column)
       bei C1.WPF.DataGrid.DataGridModel.GetCell(DataGridRow row, DataGridColumn column)
       bei C1.WPF.DataGrid.C1DataGrid.get_Item(DataGridRow row, DataGridColumn column)
       bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.get_CurrentCell()
       bei C1.WPF.DataGrid.C1DataGrid.get_CurrentCell()
    
    

    same here …

  • Posted 19 September 2017, 11:07 am EST

    It is not possible to figure out the reason from just the stack trace. Can you elaborate the issue a bit more? It’ll be helpful if you can share your code or the sample application. Does the error occur while trying to create a new object of the DataGridCell class?

    Thanks

  • Posted 19 September 2017, 11:07 am EST

    Not, I’m sorry. This is part of a two year Project and we can not share this. Since this is very complex and we do not have the time to reproduce the exact same data and situation in a sample application. As you can see in the Stacktrace in both (different) situations we access the CurrentCell Member. Like my other post please return null but not throw an Exception. I can only send you the complete Stacktrace we got from our logging System

  • Posted 19 September 2017, 11:07 am EST

    Static information:

    Computername: MONDO

    Shutdown started: False

    64bit OS: True

    OS Version: Microsoft Windows NT 6.2.9200.0

    EXE 64bit Version: False

    Messages:

    FATAL : 2015-10-01 17:02:33,065 C1.WPF.DataGrid.DataGridCell [(null)]

    ErrorMessage

    Both column and row must belong to the same data grid.

    Type: System.ArgumentException

    Source: C1.WPF.DataGrid.4

    TargetSite: Void .ctor(C1.WPF.DataGrid.DataGridRow, C1.WPF.DataGrid.DataGridColumn)

    ErrorCode: -2147024809

    StackTrace

    bei C1.WPF.DataGrid.DataGridCell…ctor(DataGridRow row, DataGridColumn column)

    bei C1.WPF.DataGrid.DataGridModel.GetCell(DataGridRow row, DataGridColumn column)

    bei C1.WPF.DataGrid.C1DataGrid.get_Item(DataGridRow row, DataGridColumn column)

    bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.get_CurrentCell()

    bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.ClearCurrentCell(Boolean preserveRow, Boolean preserveColumn)

    bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.ClearCurrentColumn()

    bei C1.WPF.DataGrid.DataGridModel.<.ctor>b__2(Object s, DataGridColumnEventArgs e)

    bei System.EventHandler`1.Invoke(Object sender, TEventArgs e)

    bei C1.WPF.DataGrid.DataGridColumnCollection.OnBeforeRemoveColumn(DataGridColumn column)

    bei C1.WPF.DataGrid.DataGridColumnCollection.ClearAutogeneratedColumns()

    bei C1.WPF.DataGrid.DataGridModel.ClearAutoGeneratedColumns()

    bei C1.WPF.DataGrid.DataGridModel.AutoGenerateColumns()

    bei C1.WPF.DataGrid.DataGridModel.Reload(Boolean createColumns)

    bei C1.WPF.DataGrid.DataGridModel.OnItemsSourceChanged(IEnumerable itemsSource)

    bei C1.WPF.DataGrid.C1DataGrid.OnItemsSourceChanged(IEnumerable oldValue)

    bei C1.WPF.DataGrid.C1DataGrid.OnItemsSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

    bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

    bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

    bei C1.WPF.DataGrid.C1DataGrid.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

    bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)

    bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)

    bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)

    bei System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)

    bei C1.WPF.DataGrid.C1DataGrid.set_ItemsSource(IEnumerable value)

    bei Ktsw.Conx.ConxClient.Controls.DataGrid.ConxDataGrid.LoadDataTable(DataTable dt) in c:\repoConx\trunk\Conx\ConxClient\Controls\DataGrid\ConxDataGrid.xaml.cs:Zeile 2427.

    bei Ktsw.Conx.ConxClient.Pages.BalanceImportWizard.BalanceImportData.set_BalanceData(IExcel value) in c:\repoConx\trunk\Conx\ConxClient\Pages\BalanceImportWizard\BalanceImportData.cs:Zeile 204.

    bei Ktsw.Conx.ConxClient.Pages.BalanceImportWizard.BalanceImport10.d__6.MoveNext() in c:\repoConx\trunk\Conx\ConxClient\Pages\BalanceImportWizard\BalanceImport10.xaml.cs:Zeile 131.

    — Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde —

    bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

    bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    bei System.Runtime.CompilerServices.TaskAwaiter.GetResult()

    bei Ktsw.Conx.ConxClient.Pages.BalanceImportWizard.BalanceImport10.d__0.MoveNext() in c:\repoConx\trunk\Conx\ConxClient\Pages\BalanceImportWizard\BalanceImport10.xaml.cs:Zeile 111.

    — Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde —

    bei System.Runtime.CompilerServices.AsyncMethodBuilderCore.b__4(Object state)

    bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

    bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

    System.ArgumentException: Both column and row must belong to the same data grid.

    bei C1.WPF.DataGrid.DataGridCell…ctor(DataGridRow row, DataGridColumn column)

    bei C1.WPF.DataGrid.DataGridModel.GetCell(DataGridRow row, DataGridColumn column)

    bei C1.WPF.DataGrid.C1DataGrid.get_Item(DataGridRow row, DataGridColumn column)

    bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.get_CurrentCell()

    bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.ClearCurrentCell(Boolean preserveRow, Boolean preserveColumn)

    bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.ClearCurrentColumn()

    bei C1.WPF.DataGrid.DataGridModel.<.ctor>b__2(Object s, DataGridColumnEventArgs e)

    bei System.EventHandler`1.Invoke(Object sender, TEventArgs e)

    bei C1.WPF.DataGrid.DataGridColumnCollection.OnBeforeRemoveColumn(DataGridColumn column)

    bei C1.WPF.DataGrid.DataGridColumnCollection.ClearAutogeneratedColumns()

    bei C1.WPF.DataGrid.DataGridModel.ClearAutoGeneratedColumns()

    bei C1.WPF.DataGrid.DataGridModel.AutoGenerateColumns()

    bei C1.WPF.DataGrid.DataGridModel.Reload(Boolean createColumns)

    bei C1.WPF.DataGrid.DataGridModel.OnItemsSourceChanged(IEnumerable itemsSource)

    bei C1.WPF.DataGrid.C1DataGrid.OnItemsSourceChanged(IEnumerable oldValue)

    bei C1.WPF.DataGrid.C1DataGrid.OnItemsSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

    bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

    bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

    bei C1.WPF.DataGrid.C1DataGrid.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

    bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)

    bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)

    bei System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)

    bei System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)

    bei C1.WPF.DataGrid.C1DataGrid.set_ItemsSource(IEnumerable value)

    bei Ktsw.Conx.ConxClient.Controls.DataGrid.ConxDataGrid.LoadDataTable(DataTable dt) in c:\repoConx\trunk\Conx\ConxClient\Controls\DataGrid\ConxDataGrid.xaml.cs:Zeile 2427.

    bei Ktsw.Conx.ConxClient.Pages.BalanceImportWizard.BalanceImportData.set_BalanceData(IExcel value) in c:\repoConx\trunk\Conx\ConxClient\Pages\BalanceImportWizard\BalanceImportData.cs:Zeile 204.

    bei Ktsw.Conx.ConxClient.Pages.BalanceImportWizard.BalanceImport10.d__6.MoveNext() in c:\repoConx\trunk\Conx\ConxClient\Pages\BalanceImportWizard\BalanceImport10.xaml.cs:Zeile 131.

    — Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde —

    bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

    bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

    bei System.Runtime.CompilerServices.TaskAwaiter.GetResult()

    bei Ktsw.Conx.ConxClient.Pages.BalanceImportWizard.BalanceImport10.d__0.MoveNext() in c:\repoConx\trunk\Conx\ConxClient\Pages\BalanceImportWizard\BalanceImport10.xaml.cs:Zeile 111.

    — Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde —

    bei System.Runtime.CompilerServices.AsyncMethodBuilderCore.b__4(Object state)

    bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

    bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

    FATAL : 2015-10-01 17:02:41,835 C1.WPF.DataGrid.DataGridCell [(null)]

    ErrorMessage

    Both column and row must belong to the same data grid.

    Type: System.ArgumentException

    Source: C1.WPF.DataGrid.4

    TargetSite: Void .ctor(C1.WPF.DataGrid.DataGridRow, C1.WPF.DataGrid.DataGridColumn)

    ErrorCode: -2147024809

  • Posted 19 September 2017, 11:07 am EST

    The error mentioned in the stack trace is “Both column and row must belong to the same data grid.”. This error will occur only when the arguments provided to the C1DataGrid constructor to access a cell do not belong to the same C1DataGrid. I could reproduce the error when I used the following code :

    C1.WPF.DataGrid.DataGridCell currentCell = c1DataGrid1[c1DataGrid1.Rows[1], c1DataGrid2.Columns[2]];

    You can notice that the column parameter is from c1DataGrid2 which is why the error occurs. Screen shot attached.

    So you’ll have to check your code and find out where this error generates and provide the correct parameters i.e both row and column must be from the same C1DataGrid.

  • Posted 19 September 2017, 11:07 am EST

    Ok, let me tell you something … this exception is not only in this case thrown. Have a look into your code and you will see this:

    
    if (row.DataGrid == null || column.DataGrid == null || row.DataGrid != column.DataGrid)
            throw new ArgumentException("Both column and row must belong to the same data grid.");
          this.Row = row;
          this.Column = column;
    
    

    As you see beside the check if datagrid of row and column are the same - there is also a null check. So if a row has no Grid anymore (it is removed) but still in your internal lists - there will be an exception and we can not do anything about this.

    So again … send this stacktrace to your dev team and stop posting stuff that does not help. This is the last thing I tell you here because this is lost time if you don’t want to correct your errors. This is not our fault. we do not have different datagrids and the exception text is wrong.

    Just send this to your dev team!

    greetings

  • Posted 19 September 2017, 11:07 am EST

    We have saved a Memory Dump for you to analyze your code and how this happend.

    I’ll attach the Minidump File to this post, so you can Debug your Code. If you need the complete Dump File with Heap we can send it to you on Request (600 MB File will be too much for this poor little forum here ;))

    greetings

    2015/10/Connexv2.zip

  • Posted 19 September 2017, 11:07 am EST

    Can you please share the scenario and the code snippet where this exception occurs? I’ll need it to be able to reproduce the issue and forward it to the development team. If they simply change the code to not throw this exception, it might break things in other scenarios where the same code is being referred.

    Thanks

  • Posted 19 September 2017, 11:07 am EST

    No sample, as I said it is a very big project and I do not have the time to find the exact circumstances when this happens.

    But to be honest with you. I dont see why a stacktrace where we set an ItemSource from C1DataGrid and the DataGrid crashes is not enough.

    Take it and forward it or close it and keep the bug in your product

  • Posted 19 September 2017, 11:07 am EST

    I’ve forwarded the stack trace to our development team and will get back to you once I get a reply from them. The tracking id for your issue is 134138

  • Posted 2 February 2018, 11:47 am EST

    Yay! 2018 - still getting the Exception all over our Application.

    Still no solution here.

    So, since this is still active i give it another shot:

    You mix up 2 Datagrids. So, Yes then this exception makes sense.

    but if you look at the stack trace you see the following line:

    “bei C1.WPF.DataGrid.C1DataGrid.get_CurrentCell()”

    this is YOUR freaking GETTER. There are no arguments there. And YOU expect us now to put a damn try … catch around EVERY line where we use the CurrentCell Member of your Datagrid. Let me try this as polite as I can be: Are you insane?!

    Here a stacktrace from today, reported from our customers to our support (so we get the blame for your failures and you take damn 4! years and can’t fix the issue):

    #### ErrorMessage ####
    Handled
    Type: Ktsw.Conx.Core.ErrorHandling.HandledException
    Source: 
    TargetSite: 
    ErrorCode: -2146233088
    
    
    #### InnerErrorMessage ####
    Both column and row must belong to the same data grid.
    Type: System.ArgumentException
    Source: C1.WPF.DataGrid.4
    TargetSite: Void .ctor(C1.WPF.DataGrid.DataGridRow, C1.WPF.DataGrid.DataGridColumn)
    ErrorCode: -2147024809
    
    
    #### MethodProtocols ####
    
    #### StackTrace ####
    
       bei C1.WPF.DataGrid.DataGridCell..ctor(DataGridRow row, DataGridColumn column)
       bei C1.WPF.DataGrid.C1DataGrid.get_Item(DataGridRow row, DataGridColumn column)
       bei C1.WPF.DataGrid.DataGridFocusAndEditingManager.get_CurrentCell()
       bei C1.WPF.DataGrid.C1DataGrid.get_CurrentCell()
       bei Ktsw.Conx.ConxClient.Controls.DataGrid.Managers.ConxDataGridSelectionManager.C1DataGridWrapper.ProcessPossibleChanges()
       bei Ktsw.Conx.ConxClient.Controls.DataGrid.Managers.ConxDataGridSelectionManager.C1DataGridWrapper.DataGridOnLayoutUpdated(Object sender, EventArgs eventArgs)
       bei System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
       bei System.Windows.ContextLayoutManager.UpdateLayout()
       bei System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
       bei System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
       bei System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
       bei System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
       bei System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
       bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
    

    This comes on accessing a damn simple GETTER. Now send this to your Dev Team and ask them if they are seriously telling us to put every Datagrid.CurrentCell Call into a try catch because you throw your damn exceptions around like candys

    Btw. No subscription from our side anymore because you fix no bug that get’s reported. Once you release a version that actually fixes something we will subscribe again.

    greetings!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels