Hi,
I have a single xamwebgrid. I am getting data from different table on button click, since datasource is changing at run time so I am adding columns using code xamwebgrid.columns.add().
When I bind the data first time everything is working fine, but as I bind the grid with other datasource (or with the same datasource), xamwebgrid.columns.add() throw NullReferenceException with message "Object reference is not set to an instance of object" and stacktrace is as follow:
at Infragistics.Controls.Grids.RowsManager.InvalidatePager() at Infragistics.Controls.Grids.RowsManager.InvalidateData() at Infragistics.Controls.Grids.RowsManagerBase.OnColumnLayoutPropertyChanged(ColumnLayout layout, String propertyName) at Infragistics.Controls.Grids.RowsManager.OnColumnLayoutPropertyChanged(ColumnLayout layout, String propertyName) at Infragistics.Controls.Grids.XamGridRowsManager.OnColumnLayoutPropertyChanged(ColumnLayout layout, String propertyName) at Infragistics.Controls.Grids.RowsManagerBase.OnColumnLayoutPropertyChanged(Object sender, PropertyChangedEventArgs e) at Infragistics.DependencyObjectNotifier.OnPropertyChanged(String propertyName) at Infragistics.Controls.Grids.ColumnLayout.InvalidateData() at Infragistics.Controls.Grids.ColumnBaseCollection.AddItem(Int32 index, ColumnBase item) at Infragistics.Collections.CollectionBase`1.Add(T item) at SBOSLCollection.Grid.EntityClass.GoodReciptPoListData.AddColumns()
My code to rebind the datagrid and add columns is as follow:
grid.ItemSource=null;
grid.Columns.Clear();
BaseColumn column= new TextColumn();
column.headerText="Title Column";
column.key="ColumnKey";
grid.columns.add(column); //Here Nullreference exception is throw.
One more thing i want to add with above issue.
I have Infragistics Silverlight control 10.1 release and every thing is working fine with this. But as i upgrage Infragistics Silverlight controls 10.2 release above mention error is occuring.
I tried to reproduce this issue with the 10.2 release and both Service Releases that have since been released. But with no luck.
Do you have a simplified sample that shows the issue?
Thanks,
-SteveZ