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

ArrayList as ListBox.DataSource

P: n/a
My problem occurs when I use an ArrayList as a ListBox.DataSource. When the
ArrayList attached to the Listbox is not empty the Listbox behave normal
without problem, but if I remove all items from the ArrayList and re-attach
the ArrayList to the ListBox the program hangs for about 3-5 seconds then
keep running normal.

I'm following the examples from the MSDN and dont see anything abnormal.
This is a sample of the code I'm using:

1 IList codesA = (IList)lstOfGroupAccessCodes.DataSource;
2 IList codesB = (IList)lstOfCodesNotInGroup.DataSource;
3 Object selectedItem = lstOfGroupAccessCodes.SelectedItem;

4 codesA.Remove(selectedItem);
5 lstOfGroupAccessCodes.DataSource = null;

6 lstOfGroupAccessCodes.DataSource = codesA;

7 lstOfCodesNotInGroup.DataSource = null;
8 codesB.Add(selectedItem);
9 lstOfCodesNotInGroup.DataSource = codesB;

The program hangs on line 6 for about 3-5 seconds when I remove the last
item of the ArrayList ( codesA.Count == 0 )

--


Jesse Martinez
Systems Developer

Multisystems, Inc
Capital Center South Tower 801
San Juan, PR, 00918
1-787-751-2720 x.231

This message may contain proprietary information intended only for it's
recipient. If you are not the intended recipient, you are hereby notified
that any disclosure, copying, or distribution of the contents of this e-mail
is strictly prohibited. If you have received this e-mail transmission in
error, please reply to the sender, so that Multisystems can arrange for
proper delivery, and then please delete the message from your inbox. Thank
you.
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.