I am using on every grid view in our application LoadLayout and SaveLayout.
On most grids all works fine, but on one of our grids I am getting a NullReferenceException.
The grid has a lot of columns and includes look up columns. When I try and load the layout for this particular grid, I am getting the following NullReferenceException
Object reference not set to an instance of an object.
at Telerik.WinControls.Data.FilterExpressionCollection.GetFieldByName(String fieldName)
at Telerik.WinControls.Data.FilterExpression.set_Owner(FilterExpressionCollection value)
at Telerik.WinControls.Data.FilterExpressionCollection.InsertItem(Int32 index, FilterExpression item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
at Telerik.WinControls.Data.Field.set_Filter(FilterExpression value)
at Telerik.WinControls.Data.Field.Initialize(Field field)
at Telerik.WinControls.UI.GridViewDataColumn.set_Field(Field value)
at Telerik.WinControls.Data.DataAccessComponent.EnsureColumns()
at Telerik.WinControls.Data.DataAccessComponent.UpdateColumns(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.UI.GridViewTemplate.UpdateColumns(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.UI.GridViewColumnCollection.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.EndUpdate(Boolean notifyUpdates)
at Telerik.WinControls.Data.ObservableCollection`1.EndUpdate()
at Telerik.WinControls.UI.GridViewLayoutSerializer.ProcessListOverride(XmlReader reader, Object listOwner, PropertyDescriptor ownerProperty, IList list)
at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadElementInObject(XmlReader reader, PropertyDescriptor property, Object toRead)
at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadObjectElement(XmlReader reader, Object parentObject, Object toRead)
at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadElementInObject(XmlReader reader, PropertyDescriptor property, Object toRead)
at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadObjectElement(XmlReader reader, Object parentObject, Object toRead)
at Telerik.WinControls.XmlSerialization.ComponentXmlSerializer.ReadObjectElement(XmlReader reader, Object toRead)
at Telerik.WinControls.UI.RadGridView.LoadLayout(String fileName)
at Multepos.Controls.GridView.LoadLayout(GridViewName gridViewName) in C:\Users\Richard\Documents\Visual Studio 2005\Projects\Multepos.Controls\GridView\GridView.vb:line 392
at Multepos.HeadOffice.UI.Forms.FileAdmin.Master.Master_Shown(Object sender, EventArgs e) in C:\Users\Richard\Documents\Visual Studio 2005\Projects\Multepos.HeadOffice.UI\Forms\File Admin\Master.vb:line 69
at System.Windows.Forms.Form.OnShown(EventArgs e)
at System.Windows.Forms.Form.CallShownEvent()
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)