Programming Entity Framework
Programming Entity Framework By Julia Lerman
February 2009
Pages: 828


Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Binding To Objectresult
aquest
post Nov 7 2009, 02:24 PM
Post #1


New Member
*

Group: Members
Posts: 1
Joined: 7-November 09
Member No.: 20,904



I am confused as to what is the best type of collection for the DataSource of a BindingSource that I want to bind to a combo box with full CRUD capability.
Chapter 8 explicitly advises to bind to an ObjectResult and not a List(of T) but I cannot see how to sort the results.
Go to the top of the page
 
+Quote Post
JulieLerman
post Nov 8 2009, 04:04 AM
Post #2


Active Member
****

Group: O'Reilly Author
Posts: 102
Joined: 17-September 08
Member No.: 836



This is a harsh reality.

Microsoft says: Use the binding lists we provide out of the box for ObjectResults and EntityCollection. We invested a lot of time in defining what the appropriate behaviors were for them.

But then we don't get things like sorting.

I don't see a change in VS2010 Beta 2 - an attempt to sort ObjectResult<T> still fails but I have asked the EF team if anything will change by RTM.

To get the best of both worlds, you may have to use an ObservableCollection (find details in MSDN Docs or lots of blog posts) or use a List<T> and put a LOT of event handling code sad.gif into the app.

(Don't shoot, I'm just the messenger!)

julie
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 22nd November 2009 - 04:57 AM