New Posts New Posts RSS Feed: Converting ReadOnlyEntityList to EntityList question
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Converting ReadOnlyEntityList to EntityList question

 Post Reply Post Reply
Author
yongbum75 View Drop Down
Newbie
Newbie


Joined: 21-Jul-2008
Posts: 17
Post Options Post Options   Quote yongbum75 Quote  Post ReplyReply Direct Link To This Post Topic: Converting ReadOnlyEntityList to EntityList question
    Posted: 09-Aug-2008 at 8:42am

I found the following tech tip but am not 100% clear on what you mean by "Note that your new list is an unmanaged one (unless and until you configure a ListManager for it), so no additional Order objects will get into it unless you expressly put them there."

Can you give me a code example that shows how to "configure a  ListManager for it"?

Thanks!


Converting a ReadOnlyEntityList<T> Into an EntityList<T>

On occasion you may want to convert your ReadOnlyEntityList<T> into a list to which you can directly add or remove entities. You can do that easily, as follows:
 

C#:

EntityList<Order> orders =
  new EntityList<Order>(mCurrentEmployee.Orders);


VB.NET:

Dim orders As EntityList(Of Order) = _
  New EntityList(Of Order)(mCurrentEmployee.Orders)

Now you can add and remove Orders freely and directly in your new orders collection. Note that your new list is an unmanaged one (unless and until you configure a ListManager for it), so no additional Order objects will get into it unless you expressly put them there.

Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 09-Aug-2008 at 9:02am
Yongbum75:
 
See the section "Keeping Your EntityList(Of T) Current with an EntityListManager" in Ch.7 (User Interfaces) of the Developer Guide.
 
There is also a code solution, "EntityListManager", in the 200 Intermediate instructional unit on "BindableList".
 
Best regards,
Greg Dunn
IdeaBlade
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down