listbox.addrange winforms

  • Thread starter Thread starter Richard Bond
  • Start date Start date
R

Richard Bond

Hi,

A colleague of mine has added a 60,000 array of strings to a listbox using
the addrange method.
He did this because it seemed the quickest method of getting 60,000 items
into the listbox.

He would now like different "text" and "value" properties for each item in
the listbox. Given the number of items, what would be the most efficient way
of doing this?

regards,

Richard
 
Richard,
First a question: how do you expect your users to navigate 60,000 items in a
list box. I would think most users would complain about navigating 60 items
in a list box, much less 1000, but 60,000??

Second I would still seriously question any design that required 60,000
items in a listbox.

You can either use a DataTable or a custom class to define text & value
pairs that the ListBox could then display.

You could possibly even use an owner draw listbox, that you bind to the
array of strings, then the DrawItem event looks up the value from the
Text...

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top