Investigating further, it seems that
MyClass2_BindingSource.SupportsFiltering, which is weird
since I DID try
BindingList<T> in addition to List<T>. The way
I see it, it should
work...
Any ideas yet?
-----Original Message-----
From: Discussion forum for developers using Windows Forms to
build apps
and controls [mailto OTNET-WI
NFORMS DISCUSS.DEVELOP.COM] On Behalf Of
Chris Bordeman
Sent: Tuesday, October 03, 2006 3:17 PM
To: DOTNET-WINFORMS DISCUSS.DEVELOP.COM
Subject: [DOTNET-WINFORMS] Noob question
Ok, I've read the relevant parts of Chris Sells' book, have
a slightly
more involved question...
I've created two classes that expose some properties. I've
declared two
List<T>s based on them:
List<MyClass1> MyList1 ...
List<MyClass2> MyList2 ...
I then used the Data Source Wizard to add both of them as
Data Sources
in my project and created 2 DataGridViews based on those
sources (drag
and drop from Data Sources window), which automatically
creates 2
BindingSources too. The *DESIGNER* initiliazes these with
code similar
to this:
MyClass1_BindingSource.DataSource = typeof(MyClass1)
MyClass2_BindingSource.DataSource = typeof(MyClass2)
Of course I only used the wizard as a convenience (creating
those
columns is a PITA), but I want it to use MY lists, not some
internal
List object, so I assign:
MyClass1_BindingSource.DataSource = MyList1
MyClass2_BindingSource.DataSource = MyList2
Which seems to work fine.
*NOW*, my problem is I want these browses to work as
Parent-Child. On
the MyClass1_BindingSource.CurrentItemChanged event, I am
checking the
selected item (contains what I expect it contain), then I
set
MyClass2_BindingSource.Filter accordingly.
I've verified the filter is changing, to the value I want,
but the
second Grid is NOT reflecting any change in the filter.
Whew...so what stupid noob mistake am I making? I tried
using
BindingList<T> instead of List<T> but no
difference.
Many thanks,
Chris
|