By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,997 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,997 IT Pros & Developers. It's quick & easy.

Databound listbox sort order not updated?

P: n/a

(Cross-posted to microsoft.public.dotnet.framework.adonet)

I've got a form with a listbox and a textbox on it. Both are bound to a
DataView, which is sorted on the "Name" field of the underlying table. That
is, I've got

myDataView.Sort = "Name"

Both the textbox and listbox are bound to the "Name" property of the
DataView. My problem is that when I update the Name of a record, the listbox
is not properly updating. I have installed a handler for the Validated event
of the textbox and have called
(BindingContext[myDataView] as CurrencyManager).Refresh ();
which updates the strings in the listbox, but they are no longer properly
sorted. That is, if I change the Name such that its position within the
DataView changes, the listbox order is invalid -- it is the original order
of the DataView, not its new order.

Any help is appreciated.



Nov 16 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.