Groups | Blog | Home
all groups > dotnet windows forms databinding > june 2006 >

dotnet windows forms databinding : Implement IBindingListView on List<T>


JT
6/25/2006 12:21:01 PM
Hi,
I recently replaced a datatable with a lighter weight generic List<myClass>
object. I created a BindingSource, made the List the DataSource for the
BindingSource, and the set the BindingSource as the datasource for a
DataGridView. I managed to implement filtering and sorting for single
columns using FindAll and Sort methods of the List and delegates. What I
cannot restore to the datagridview is the ability to sort by any column.
This requires advanced sorting support. However, as I try to figure this
implementation out, it leads me to one long series of help pages with NO
EXAMPLES. I feel the key is the ListSortDescriptionCollection, but cannot
find an example of this no matter how far I drill down into the online
documentation.

Bottom line - could I get an example of how to implement advanced sorting on
a List<T> that will allow the datagridview to sort by any column?

Thanks.
--
JT
6/25/2006 7:26:02 PM
Never mind.

I found this extremely helpful link to guide me. This actually looks like a
FANTASTIC book...

http://book.itzero.com/read/microsoft/0602/Addison.Wesley.Data.Binding.with.Windows.Forms.2.0.Programming.Smart.Client.Data.Applications.with.dot.NET.Jan.2006_html/032126892X/ch07.html
--
John


[quoted text, click to view]
JT
6/25/2006 8:28:01 PM
overrides NeverMind
NeverMind.Cancel

When I implement the BindingListView<T> referenced in the code from the link
below, the datagridview sorts well and filters well. But, when I go to
remove the filter, any rows that did not match the filter criteria appear to
be gone from the list. This happens if I set the filter on the
BindingSource, or on the BindingListView<T> instance. Any help would be
appreciated.
--
John


[quoted text, click to view]
JT
6/25/2006 10:31:01 PM
IMPORTANT:
THE LINK I POSTED TO BOOK.ITZERO.COM IS TO AN ILLEGAL, PIRATED SITE. I DID
NOT KNOW THAT WHEN I POSTED. PLEASE REMOVE THIS ENTIRE THREAD FROM THE
NEWSGROUP! ALSO, PLEASE REMOVE MY POST AT
http://msdn.microsoft.com/newsgroups/managed/default.aspx?&query=JT&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.dotnet.framework.windowsforms.databinding&p=1&tid=331c7d0b-3e35-4485-a83c-8280e57f0bfb&mid=b0b16a38-ff6d-4096-8fd0-252546506929

IT ALSO REFERENCES THIS ILLEGAL SITE.

THANK YOU.

--
John


[quoted text, click to view]
v-lliu NO[at]SPAM online.microsoft.com
6/26/2006 11:44:08 AM
Hi John,

Thank you for posting.

It seems hard to find a sample for the implementation of the interface
IBindingListView.

I am performing research on this issue and will get back to you as soon as
possible. I appreciate your patience.


Sincerely,
Linda Liu
Microsoft Online Community Support

====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================
JT
6/26/2006 12:22:01 PM
Hi Linda,
Please see my fourth post. We need to get this thread off of the newsgroup.
I have resolved my issue.
--
John


[quoted text, click to view]
v-lliu NO[at]SPAM online.microsoft.com
6/27/2006 12:00:00 AM
Hi John,

Thank you for your response. If you have any other questions, please don't
hesitate to contact us.

Have a nice day!

Sincerely,
Linda Liu
Microsoft Online Community Support

====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================
AddThis Social Bookmark Button