Strange ListBox Behavior when Bound To a DataTable

When I was putting data from a DataTable as shown in the code below:

DataView locationsView = new DataView(MyDataSet.Tables["locations"]);
locationsView.Sort = "name ASC";
lstLocations.ValueMember = "key";
lstLocations.DisplayMember = "name";
lstLocations.DataSource = locationsView;

I got a very strange result as seen below:

Once I set the Sorted property to False, it worked fine. Go figure.

Bug Submitted By: David McCarter


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.