Object Reference Not Set on Grid when adding customer field

Morning All,

This appears to be a bug with custom code on adding a field to grid. We are adding part data to PO Suggestions. We added the following code. Then when we select the entire row of the grid and close out of the window we get the below error. If we select a cell in the grid there is no error.

If I comment out the grdMatParts lines, no error occurs.

Anyone else see this before, any tricks to get around it.

public class Script
{
 EpiUltraGrid gridMatParts;

	public void InitializeCustomCode( )
	{
		// Begin Wizard Added Variable Initialization
		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls
		SetExtendedProperties( );
		// End Wizard Added Custom Method Calls
		
		gridMatParts = ( ( Ice.Lib.Framework.EpiUltraGrid )csm.GetNativeControlReference( "4d59326f-7a76-4c5c-8e2c-54e630db64da" ) );
		gridMatParts.DisplayLayout.Bands[ 0 ].Columns.Add( "PartLookupDNBType_c", "Buyer Status" );
		gridMatParts.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler( grdTPLst_InitializeRow );

Application Error

Exception caught in: Ice.Lib.EpiClientLib

Error Detail

Message: Object reference not set to an instance of an object.
Program: Ice.Lib.EpiClientLib.dll
Method: TrackLastActiveGrid

Client Stack Trace

at Ice.Lib.Framework.EpiUltraGrid.TrackLastActiveGrid()
at Ice.Lib.Framework.EpiUltraGrid.afterSelected(Object sender, AfterSelectChangeEventArgs ea)
at Infragistics.Win.UltraWinGrid.UltraGrid.OnAfterSelectChange(AfterSelectChangeEventArgs e)
at Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(GridEventIds id, EventArgs e)
at Infragistics.Win.UltraWinGrid.UltraGrid.SelectNewSelection(Type type, Selected selected)
at Infragistics.Win.UltraWinGrid.UltraGrid.ClearSelectedRows()
at Infragistics.Win.UltraWinGrid.SelectedRowsCollection.Clear()
at Infragistics.Win.UltraWinGrid.UltraGridBase.Set_ListManager(Object newDataSource, String newDataMember)
at Infragistics.Win.UltraWinGrid.UltraGridBase.set_DataSource(Object value)
at Infragistics.Win.UltraWinGrid.UltraGridBase.DataSource_Disposed(Object sender, EventArgs e)
at System.ComponentModel.Component.Dispose(Boolean disposing)
at System.Windows.Forms.BindingSource.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at Ice.Lib.Framework.EpiUltraGrid.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at Ice.Lib.Framework.EpiUserControl.Dispose(Boolean disposing)
at Ice.Lib.Framework.EpiBasePanel.Dispose(Boolean disposing)
at Erp.UI.App.POSuggEntry.MaterialListPanel.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at Infragistics.Win.ManagedContainerControlBase.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at Infragistics.Win.UltraWinDock.UltraDockManager.DestroyControl(Control control)
at Infragistics.Win.UltraWinDock.UltraDockManager.RemoveControlPaneContainer(DockableControlPane pane)
at Infragistics.Win.UltraWinDock.UltraDockManager.UninitializeComponent()
at Infragistics.Win.UltraWinDock.UltraDockManager.set_HostControl(ContainerControl value)
at Infragistics.Win.UltraWinDock.UltraDockManager.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.ComponentModel.Container.Dispose(Boolean disposing)
at System.ComponentModel.Container.Dispose()
at Ice.Lib.Framework.EpiDockManagerPanel.Dispose(Boolean disposing)
at Erp.UI.App.POSuggEntry.Panels.MainPanel.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at Infragistics.Win.ManagedContainerControlBase.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at Infragistics.Win.UltraWinDock.UltraDockManager.DestroyControl(Control control)
at Infragistics.Win.UltraWinDock.UltraDockManager.RemoveControlPaneContainer(DockableControlPane pane)
at Infragistics.Win.UltraWinDock.UltraDockManager.UninitializeComponent()
at Infragistics.Win.UltraWinDock.UltraDockManager.set_HostControl(ContainerControl value)
at Infragistics.Win.UltraWinDock.UltraDockManager.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.ComponentModel.Container.Dispose(Boolean disposing)
at System.ComponentModel.Container.Dispose()
at Erp.UI.App.POSuggEntry.POSuggEntryForm.Dispose(Boolean disposing)
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at Ice.Lib.Framework.EpiForm.WndProc(Message& message)