Filtered Binding List - on CSLA 1.x Editable Child Collection

Filtered Binding List - on CSLA 1.x Editable Child Collection

Old forum URL: forums.lhotka.net/forums/t/2525.aspx


JoeFallon1 posted on Wednesday, March 14, 2007

I have a mixed environment of CSLA 1.x and 2.0. While I am transitioning I would like to use the filtered binding list against a CSLA 1.x ECC named ImcaECC. The child objects named Imca are not nested classes. They stand alone. The code compiles but throws an exception at run time. Is that the expected behavior?

mFilteredList = New Csla2.FilteredBindingList(Of Imca)(ImcaECC, AddressOf Me.Filter)

I get an exception on the line above saying:
Unable to cast object of type ImcaECC to type System.Collections.Generic.IList'[Imca]

Joe

 

 

amselem replied on Wednesday, March 14, 2007

Yes I think that it's the expected behavior. I had the same problem, this is because ECC in 1.x doesn't implement the generic interface IList(Of ..) and FilteredBindingList is looking for that (ECC implements the IList interface but it's not the same). I ended using the old FilterableCollectionBase for 1.x classes and FBL for 2.0 until I could migrate all the classes to 2.0. 
BTW, all this also applies to SortedBindingList.

Jacobo

JoeFallon1 replied on Thursday, March 15, 2007

Thanks.

Thought it was something like that.

I used the ObjectListView instead. It works for 1.x and 2.0 plus you can do multiproperty sorting and filtering.

Joe

 

Copyright (c) Marimer LLC