I have an ObservableCollection that I am binding the grid to which contains about 19,000 rows and whenever I try to bind with filtering enabled I get the following error:
An unhandled exception of type 'System.StackOverflowException' occurred in Infragistics3.Wpf.DataPresenter.v9.1.dll
The scroll mode is Immediate, RecordLoadMode is Preload and CellContainerGeneration is PreLoad but I stil have the same problem.
I was able to make this happen as well.... It certaintly is not the number of rows... and it seems that it is not the names of unboundfields. When I turn off filtering then it works.....
Dave,
I suppose this is the problem, that it is used as a key. This is an issue and I am going to notify our Engineering team. However, for now, I am not able to reproduce it in a simpler isolated scenario. When I succeed I will create a support case on your behalf and log this issue.
Regards,
Alex.
Thanks Alex,
That was an easy fix! I wonder if MagellanTX made the same mistake.
I would not have guessed I needed to set the name, as I hadn't done up until now and all other features worked fine without it!
Looking in the documentation, it states it is used as the key into the FieldCollection - which would imply it's required - I wonder how it gets added to the collection when I didn't set it....
Therefore, should an appropriate exception be raised if you attempt to add an UnboundField without setting the name? Is it a 'bug' that it hangs then throws a StackOverflow exception (that doesn't help much in determining the cause)?
Dave
Hello Dave,
The problem actually is that you do not set a Name of the UnboundField. Try setting the Name property like this:
With field
.Label = "Animal"
.Name = "newName"
.BindingMode = BindingMode.OneWay
.BindingPath = New PropertyPath("Name")
End With
and this will solve this issue.
Hi Alex / MagellanTX,
I experienced the same thing in our project a few days ago - I've been working on creating a sample that exhibits the problem and believe I've narrowed down the cause now.
I've found it has nothing to do with the number of rows in the collection, the ScrollMode, RecordLoadMode or CellContainerGeneration.
It appears more to do with the fact I'm creating the field layout manually, comprised of UnboundFields.
The sample I've attached auto generates the fields and binds to a very simple ObservableCollection of 4 items - this works fine. Within "MockGrid.vb", If you comment the line "Me.FieldLayoutSettings.AutoGenerateFields = True" and un-comment the following line "Me.SetupFieldLayout()", the application will hang when you click the "Document 1" button and eventually fall over with the StackOverflow exception.