I am trying to add a DetailGrid to my grid and I keep getting the following exception when I open the grid:
System.NullReferenceException: Object reference not set to an instance of an object.
at Xceed.Grid.DetailGrid.UpdateDetailGridTemplateBinding(DataRow dataRowSample)
at Xceed.Grid.DetailGrid.UpdateDetailGridsOfMySelfAndSyncronizedChild()
at Xceed.Grid.DetailGrid.DataManager_DataRowsChanged(DataRowsChangedEventArgs e)
at Xceed.Grid.DataManager.InvokeOnDataRowsChanged(DataRowsChangedEventArgs e)
at Xceed.Grid.DataManager.CreateDataRows()
at Xceed.Grid.DataManager.ReadDataRows()
at Xceed.Grid.GridControl.OnBindingContextChanged(EventArgs e)
This occurs if I have the following code implemented in my main grid:
DeltaGrid deltaGrid = new DeltaGrid ();
this.DetailGridTemplates.Add (deltaGrid);
If these lines are commented out, the grid opens fine.
I have simplified the DeltaGrid as much as I can think to, and it still doesn’t work. Any ideas what may be causing this exception?
Imported from legacy forums. Posted by Doug (had 1910 views)