Home › Forums › WinForms controls › Xceed Grid for WinForms › Detailgrid exception when re-setting DataSource after update
-
AuthorPosts
-
#16005 |
Hi,
I have a master/detail grid bound to an object collection (LLBLGen’s EntityCollections) that has a relationship. I have created the grid using the designer, set the datasource and the datamember. Everything works fine, untill I update a row in the detailgrid and tries to set the datasource again. Then this exception occurs:
{System.NullReferenceException: Object reference not set to an instance of an object.
at Xceed.Grid.Row.GetParentGridFromContainingList(IStructuredList structuredList)
at Xceed.Grid.DetailGrid.IsParentOf(Row row)
at Xceed.Grid.DetailGrid.ClearGridBody(Boolean unbindSubGrid)
at Xceed.Grid.DetailGrid.DataManager_DataRowsChanged(DataRowsChangedEventArgs e)
at Xceed.Grid.DataManager.InvokeOnDataRowsChanged(DataRowsChangedEventArgs e)
at Xceed.Grid.Collections.DataRowList.OnClearComplete()
at Xceed.Utils.Collections.ListBase.InternalClear()
at Xceed.Grid.DataManager.UnbindFromDataSource(Boolean clearDataRows)
at Xceed.Grid.DataManager.BindToDataSource(Object dataSource, String dataMember, Boolean onlyWhenNotSameList, Boolean& dataChanged)
at Xceed.Grid.DataManager.ForceDataBinding(Object dataSource, String dataMember, Boolean onlyWhenNotSameList, Boolean createDataRows)
at Xceed.Grid.DataManager.SetDataBinding(Object dataSource, String dataMember)
at Xceed.Grid.DetailGrid.set_DataSource(Object value)
at Xceed.Grid.GridControl.set_DataSource(Object value)
at Eni.GVDB.Client.Administration.UsersView.PopulateGrid(EntityCollection`1 _usersCollection)I have searched for it everywhere, but not found any cases with the same type of exception. Can anyone help me please?
Best regards,
AnnetteImported from legacy forums. Posted by annetteS (had 2597 views)
When you are changing the DataSource, are you also modifying the DataSource and the DataMember of the DetailGrid? Also, are you calling the UpdateDetailGrids() method after the re-binding?
Imported from legacy forums. Posted by CharlesB (had 238 views)
Hi,
Thanks for the reply. I thought I had tried calling UpdateDetailsGrid(), but apparently not, because that makes it work!
Thanks!
Regdards,
AnnetteImported from legacy forums. Posted by annetteS (had 3544 views)
-
AuthorPosts
- You must be logged in to reply to this topic.