none
How many entries ( lines) are allowed in a list box?

    Question

  • Is there any limtations for number items a listbox control can have.

    since im using the listbox handle to pass to the VC dll to post the data back to the listbox.listbox will get's populated with items continuously,its clear the items from the listbox which are first got posted, like first in first out.
    Thursday, January 22, 2009 12:02 PM

Answers

  • Hi

     I have populated a list box with 100,000 rows and my page did not freeze. Do you have more than that? It was a little slow, but much faster when I turned view state off. If you don't need the view state that might be a help. Populating 1,000,000 rows displayed 27866 rows with the last row having the message:


    Administrator Note:
    An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

    While the page was loading I got a 'virtual memory is running low' error message. The event log notified me that the IIS Admin Service terminated unexpectedly, look like 1 million was a little much!


    Please remember to click 'Mark as Answer' on the post that helped you. Unmark if it provides no help
    • Proposed as answer by Sreenath G V Thursday, January 22, 2009 12:35 PM
    • Marked as answer by Kira Qian Wednesday, January 28, 2009 1:41 AM
    Thursday, January 22, 2009 12:20 PM
  • Technically, the number of items in a LB is only limited by available virtual memory.  Mercifully, there's a bug in Vista that prevents an LB from scrolling properly when there are more than about 65550 items in the list (65535 + number of lines).  That same bug shows up in a ComboBox' dropdown list.  Having that many items is way past the point of reasonable UI design, the user won't stand a chance to find the right one.
    Hans Passant.
    • Marked as answer by Kira Qian Wednesday, January 28, 2009 1:41 AM
    Thursday, January 22, 2009 12:33 PM

All replies

  • Hi

     I have populated a list box with 100,000 rows and my page did not freeze. Do you have more than that? It was a little slow, but much faster when I turned view state off. If you don't need the view state that might be a help. Populating 1,000,000 rows displayed 27866 rows with the last row having the message:


    Administrator Note:
    An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

    While the page was loading I got a 'virtual memory is running low' error message. The event log notified me that the IIS Admin Service terminated unexpectedly, look like 1 million was a little much!


    Please remember to click 'Mark as Answer' on the post that helped you. Unmark if it provides no help
    • Proposed as answer by Sreenath G V Thursday, January 22, 2009 12:35 PM
    • Marked as answer by Kira Qian Wednesday, January 28, 2009 1:41 AM
    Thursday, January 22, 2009 12:20 PM
  • Technically, the number of items in a LB is only limited by available virtual memory.  Mercifully, there's a bug in Vista that prevents an LB from scrolling properly when there are more than about 65550 items in the list (65535 + number of lines).  That same bug shows up in a ComboBox' dropdown list.  Having that many items is way past the point of reasonable UI design, the user won't stand a chance to find the right one.
    Hans Passant.
    • Marked as answer by Kira Qian Wednesday, January 28, 2009 1:41 AM
    Thursday, January 22, 2009 12:33 PM