.net cf listbox / combobox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm developing a .NET Compact Framework app in VB.NET that uses list-boxes
and combo-boxes. I need to know how many items each control will hold. I've
looked through the help but haven't found the answer. My own tests indicate
the limit to be 1071 (for both controls). Does anyone else know if that is
correct or not?
 
Regardless of the limit, I'd not hold more than 50 objects (100 if you
absolutely have to) in these controls, especially on the small screens you
associate with devices running .Net CF...
 
I'd guess it's simply limited by memory, though as Dan alludes, holding that
many items in a combo/list is poor design.
 
Thanks to both of you (Chris and Dan) for your quick responses. I do
understand the design consideration that both of you mention (and agree),
but...

My app uses "lookup tables" to populate combo-boxes and pick-lists on the
device so the user can choose them and not manually type them in. Most of
these will have less than 50 to 100 items. But several of them, two in
particular, could have lookups containing items into the 1000's. My design
uses a special "find form" that gives the user the opportunity to "filter"
the list of items returned. However, my boss wants to leave the user with
the option of returning all items.

Any further suggestions?

Thanks again - Kade
 
Kade,

There's a number of ways you could bring this down... something I guess
you'll have to play with, to see what works with your data set.

An idea, for example, that I've just had is that if the the returned record
count is greater than some amount, then progmatically create a sencond
dialog... from here the first would contain, some sort of filter, perhaps
the alphabet, through which the second would be populated. So the user could
select "C" from the first drop down, and have the second populated with all
records starting with "C...".

Good luck with this, UI design around handheld devices is an art, as I'm
learning!

Dan.
 
Kade,

I have been recently working on a ListBox that loads records from a
proprietary binary database file, not XML or SQLCE. These files can contain
any number of records, though most of them usually have < 100 records. The
largest number of records in a particular file is near 10,000. This one did
load into the ListBox and I was able to display them all so I did not find a
limit on the ListBox control. However, loading these records into an array
and then attaching it as a DataSource took around 66 seconds, way too slow
for a user.

I modified my code so that any files that have a record count over 300 now
use what I call a "sliding" mechanism. I simply load the first 50 records
into the ListBox and each time the user taps on the vertical scroll bar,
either up or down, it loads another 50 records until all of them have
loaded. This mechanism seems to work fine thus making the initial load time
of 50 records within a second or so instead of the 66 seconds previously.
Any file that has less than 300 records seems to load OK within a few
seconds and so is acceptable. I do not use the "sliding" mechanism on those
files that have < 300 records.

Just thought I would let you know of my recent experience in this area.

Regards,
Neville Lang
 
Neville,

That's a good idea...

A possible problem here though in this situation; imagine the user were to
scroll to the bottom of the listbox, and in doing so loads all the data,
then if the memory on the device is less than the memory required to load
all the data into the control, it will crash.
Unfortunately that appears to be the case for the device Kade is using.
 
Neville,

Interesting. I've actually considered a similar approach, though not
identical. I think I may have a similar dataset. Generally, I use combo
boxes in my app. But for the "combos" that use the largest tables, I have
replaced them with a clickable label and an image control that make it look
like a combo. Clicking the label or image opens a "find" form which has a
textbox, a listbox and a find button. Clicking the find button populates the
listbox with the items. If there happen to be some characters in the
textbox, I use a SQL "Like" to only return those items beginning with that
series of characters. Once the list in populated, selecting an item closes
the "find" form and places the selected value into the "combo" which is
really a clickable label control.

What I also thought about doing is the part that is really similar to you,
that is, adding beginning, previous, next, and end buttons to traverse
through the dataset. I am not sure what kind of SQL to use to allow that
though, although I'm sure its relatively easy.

I like your approach because it is probably more intuitive than the find
form, but I still have to figure out how to return the next 50 (or whatever
number) items.

Thanks,

Kade
 
Dan,

Thanks for the response(s).

I'm not too worried about the app crashing (yet!), just all records not
loading (if user has chosen to load all records, which of course is going to
cost them some time).

It would be nice to know the "limit" but it sounds like the limit is not in
the control but in the device itself.

Designing around the limitations of these devices really is an art.

Thanks,

Kade
 
Back
Top