Binding To Objectresult |
![]() ![]() |
Binding To Objectresult |
Nov 7 2009, 02:24 PM
Post
#1
|
|
|
|
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. |
|
|
|
Nov 8 2009, 04:04 AM
Post
#2
|
|
|
|
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 (Don't shoot, I'm just the messenger!) julie |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd November 2009 - 04:57 AM |