Home › Forums › WinForms controls › Xceed Grid for WinForms › Exception at GetParentGridFromContainingList when using xceed Grid for .NET in MVP
-
AuthorPosts
-
#17722 |
Hi there,
I’m having a really hard time using the grid in my WinForms MVP Application. I use the presenter to query data from the database, populate an IList and set that as the datasource for the grid. This works so far.
When it comes to editing, insertion and deletion, I handle events like cell.EditLeft to fire an event that makes the presenter write the new value to the DB. After that I’m calling my presenters OnViewLoaded which reloads the data from the DB and sets the new values as the DataSource for the grid.
Under some circumstances I get the following exception:
Exception Source: Xceed.Grid
Exception Type: System.NullReferenceException
Exception Message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Exception Target Site: GetParentGridFromContainingList
—- Stack Trace —-
Xceed.Grid.Row.GetParentGridFromContainingList(structuredList As IStructuredList)
L-Mobile Offline.EXE: N 00067
Xceed.Grid.DetailGrid.IsParentOf(row As Row)
L-Mobile Offline.EXE: N 00076
Xceed.Grid.DetailGrid.ClearGridBody(unbindSubGrid As Boolean)
L-Mobile Offline.EXE: N 01385
Xceed.Grid.DetailGrid.DataManager_DataRowsChanged(e As DataRowsChangedEventArgs)
L-Mobile Offline.EXE: N 02250
Xceed.Grid.DataManager.InvokeOnDataRowsChanged(e As DataRowsChangedEventArgs)
L-Mobile Offline.EXE: N 00239
Xceed.Grid.Collections.DataRowList.OnClearComplete()
L-Mobile Offline.EXE: N 00239
Xceed.Utils.Collections.ListBase.InternalClear()
L-Mobile Offline.EXE: N 00169
Xceed.Grid.Collections.ReadOnlyDataRowList.InternalClear()
L-Mobile Offline.EXE: N 00040
Xceed.Grid.DataManager.UnbindFromDataSource(clearDataRows As Boolean)
L-Mobile Offline.EXE: N 00234
Xceed.Grid.DataManager.ForceDataBinding(dataSource As Object, dataMember As String, onlyWhenNotSameList As Boolean, createDataRows As Boolean)
L-Mobile Offline.EXE: N 00977
Xceed.Grid.DetailGrid.Clear()
L-Mobile Offline.EXE: N 00232
Xceed.Grid.MasterGrid.Clear()
L-Mobile Offline.EXE: N 00110
Xceed.Grid.GridControl.Clear()
L-Mobile Offline.EXE: N 00081
Project.MaterialPresenter.OnViewLoaded()
MaterialPresenter.vb: line 0028, col 03, IL 0018
LMobile.SmartClient.Mvp.MasterPresenter`1.OnViewLoaded()
L-Mobile Offline.EXE: N 00116
LMobile.SmartClient.Mvp.MvpShell.Activate(masterPresenterKey As String, presenterKey As String, controller As IWorkStepController)
L-Mobile Offline.EXE: N 02140
Project.ServiceOrderMasterPresenter.OnMaterial()
ServiceOrderMasterPresenter.vb: line 0121, col 03, IL 0060
Project.ServiceOrderMasterView.OnMaterial(sender As Object, e As EventArgs)
ServiceOrderMasterView.vb: line 0132, col 03, IL 0019
System.Windows.Forms.Control.OnClick(e As EventArgs)
L-Mobile Offline.EXE: N 00100
System.Windows.Forms.Button.OnMouseUp(mevent As MouseEventArgs)
L-Mobile Offline.EXE: N 00274
System.Windows.Forms.Control.WmMouseUp(m As Message&, button As MouseButtons, clicks As Int32)
L-Mobile Offline.EXE: N 00998
System.Windows.Forms.Control.WndProc(m As Message&)
L-Mobile Offline.EXE: N 12254108
System.Windows.Forms.ButtonBase.WndProc(m As Message&)
L-Mobile Offline.EXE: N 00473
System.Windows.Forms.Button.WndProc(m As Message&)
L-Mobile Offline.EXE: N 00035
System.Windows.Forms.ControlNativeWindow.WndProc(m As Message&)
L-Mobile Offline.EXE: N 00069
System.Windows.Forms.NativeWindow.Callback(hWnd As IntPtr, msg As Int32, wparam As IntPtr, lparam As IntPtr)
L-Mobile Offline.EXE: N 00180
I tried A LOT of things to to get this working, but I’m not any closer to the solution
The changes to the IList are not required, but probably conflicting somehow? I just need a one way binding. I also got the feeling, that my problem somehow involves the currentRow. I tried setting the currentRow to dataRows(0) and the selectedRows to the currentRow, but in the circumstances that produce the error, no selection is visible.
Any ideas what might cause this?
I can supply code if required.
Thanks in advance.
Sven
Imported from legacy forums. Posted by Sven (had 5154 views)
Hi Sven,
We would need a small stand-alone test project that reproduces the issue in order to investigate. Please send it to support@xceed.com and include a link to this forum thread for reference. Thank you.
Imported from legacy forums. Posted by Diane [Xceed] (had 915 views)
-
AuthorPosts
- You must be logged in to reply to this topic.