We are using 11.1..
In our GUI, when the user refreshed data on the grid, we call
xamGrid.Columns.Clear
and then do something like this...
if (xamGrid.Columns[colName] == null)
{
textColumn = new TextColumn();
textColumn.Key = colName;
xamGrid.Columns.Add(textColumn);
}
We get an "Object reference not set to an instance of an object" at the line xamGrid.Columns.Add ..
The stack trace shows this
at Infragistics.Controls.Grids.XamGridRowsManager.InvalidateGroupBy(Boolean reset).
How do I get rid of this error? I verified that the column count was zero after the call to the Columns.Clear
Hi,
I tried the code you posted in a button click, and it worked just fine:
this.grid1.Columns.Clear(); if (grid1.Columns["Number"] == null) { TextColumn tc = new TextColumn(); tc.Key = "Number"; this.grid1.Columns.Add(tc); }
What do you mean by referesh data...are you calling a method on the xamGrid or applying a new itemsSource?
Where are you adding the new columns? By that, i mean are you calling int while the xamGrid is performing an operation?
If you have a sample that shows this issue, it'd be much more helpful, and would allow me to figure out the problem a lot quicker.
Thanks,
-SteveZ
I am having the same issue. It happens only when grid is not part of visual tree (for example you try to add columns and you have different view navigated). I will create bug request for this.
What is the status of this bug? I am getting the same error.
Fixed. Thanks
That fix was in a previous service release. You should ensure that you are using Build 11.1.20111.2073 or greater
I can't access the bug report for this (There was a problem retrieving the bug reports).
http://devcenter.infragistics.com/Protected/MyBugReports.aspx?type=Search&bugnum=84462
Will the SR be released for 2011.1?
Is there a workaround? (e.g. only refresh if the grid is one screen!!!)
- Michael Blake
The bug number is: 84462
And it has been resolved and will be in the next SR which should hopefully be out within a week.