EntityCollections and the Ajax ReorderList

Posts   
 
    
arjanv
User
Posts: 514
Joined: 15-Nov-2006
# Posted on: 01-Aug-2007 11:22:32   

Hi,

I was wondering if anyone has used an EntityCollection as datasource for the Ajax ReorderList. I tried to get it working and it seems that the only way to make it work properly is to create a List<MyEntity> and fill it with the entities from the Collection I want to use. It would appear that the ReorderList is expecting an implementation of IList as datasource. And the EntityCollection doesn't implement that interface.

t.i.a.

Arjan Vermunt Orangehill

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 01-Aug-2007 16:13:40   

You may use the CopyTo() method of the entityCollection to copy it to an Array (which implements IList).

arjanv
User
Posts: 514
Joined: 15-Nov-2006
# Posted on: 02-Aug-2007 09:36:06   

Maybe it would be nice to have an overload that expects a generic list.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 02-Aug-2007 12:43:37   

EntityCollection does implement IList, check with reflector or the sourcecode simple_smile

Collections are bound through an entityview(2), which also implements IList.

Frans Bouma | Lead developer LLBLGen Pro
arjanv
User
Posts: 514
Joined: 15-Nov-2006
# Posted on: 02-Aug-2007 13:49:57   

that's odd...... When I manually create a List<MyEntity> the ReOrderList works fine, but when I directly ssign a collection as datasource it doesn't.

any ideas what can cause this? I could create a testcase, but it will take me some time...

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Aug-2007 15:13:26   

EntityCollection classes inherits from IBindingList which inherits from IList.

Maybe it would be nice to have an overload that expects a generic list.

Here is another one => use the GetList() method of the entityCollection, which returns IList.