C
Chris Bordeman
Pardon the fairly noobish question here...
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 mistake am I making? I tried using BindingList<T> instead of
List<T> but no difference. I've read Chris Sells' book, nothing there that
helped me.
Many thanks!
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 mistake am I making? I tried using BindingList<T> instead of
List<T> but no difference. I've read Chris Sells' book, nothing there that
helped me.
Many thanks!