Bug or what?

  • Thread starter Thread starter AlexS
  • Start date Start date
A

AlexS

I have form with one of tabpages having 2 listboxes and 2 combo boxes.
I load them using DataSource property in initializer - by default. I just
assign DataViews, which are built from underlying DataTables. So, I have 4
different tables where I get data from.

Strange thing happened. While all boxes were unsorted everything was fine.
Then I got from one of table unsorted data and thought to make it easier for
user - set all boxes, list and combo, to sorted. And I got exceptions in
both listboxes. Collection can't be modified - something like that
exception, which you see usually when trying to remove item from collection
while doing for each. Strange thing - it happened on listbox EndUpdate calls
in both cases. According to stack trace - somewhere inside framework, which
checks data source inside Sort method call.

When I set Sorted = false on both listboxes (removed Sorted = true) and left
combos sorted exceptions disappeared.

I run Net 1.1 SP1.

Looks like behavior of combos is quite different from listboxes in respect
of sorting.

Now I wonder and ponder - is that something related to 1.1 or I am doing
something wrong?

Just a Q
 
Thanks

Sort of explains.

But exceptions are thrown in listboxes, not in combos. Sorted combos are
eating DataViews ok. Sorted listboxes choke.

How's that in Net 2.0?
 
I've run into this issue before with the ComboBox control in version 1.1 of
the framework. I would assume that the safest thing to do would be to
explicitly handle sorting in the DataView and leave the Sorted property set
to false.
 
Back
Top