Have you tried manually refreshing the CollectionView after update by
CollectionView.Refresh()?
--
-- Lukás(
On 18.8.2010 17:35, Ken MacDonald wrote:
I have inherited a WPF/ipy app which is using data binding /
CollectionView to interact with a customer list. Steps are roughly:
1. query cust. list from DB, sorted by name
2. bind this to a CollectionView
3. step through the list, displaying 1 cust. at a time using the
CollectionView.Next/Previous (forget the exact name) operators,
moved thru the list in alpha-sorted order
4. re-sort the list by, say, customer type. Still moves thru the list
with Next/Previous except now sorted by type, no longer by alpha.
Perfect so far, but............
5. New customers (maybe) have been added to the DB. I re-query the
customer list to pick up any new ones. The new list is sorted by
customer type (remembered my last sort criteria).
6. bind this to a CollectionView.
7. step thru the list, using Next/Previous on the CollectionView. The
customers appear in *utterly random order*, not by alpha, not by
customer type.
So, I'm a bit stymied. I've been looking through the MSDN but haven't
seen anything that addresses how to update CollectionView/data binding
to reflect new data in the customer list, or whether it is, in fact,
possible to do so. I've found a couple of hints, and tried dozens of
variations on the code that seems like it should "just work". It's
quite tempting to just maintain my own lists and navigation in python.
I've deliberately NOT included any code; for one thing, it's scattered
over a number of modules of python (and XAML) but am interested in how
any of you would approach the re-binding-to-new-data problem; also, if
any of you tried it and found it equally as bizarre and arcane and
impossible as it seems to be for my app.
Thanks!
Ken
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com