none
Performance issue while displaying last "n" items in Windows Forms ListBox (Visual Studio 2015) RRS feed

  • Question

  • Hi,

    I am using ListBox to display last "n" items (say 10000) for a Real Time application. I am receiving around 10 lines of data for a fraction of second from a system. Once ListBox line reaches "n" (say 10000), I am manually removing first 10  items (using While loop) and adding newly received 10 items (using While loop). As data input traffic is more, UI is freezing while performing delete/add operation. Application is working fine if we comment delete operation. Means if we perform only add operation, application is working fine for more than 1 lack lines.

    So kindly share the suggestion:

    1. How can we display only last "n" items in UI?

    2. Any other option is available other than ListBox?

    3. Is there any LINQ query available to delete first few items (say 10) from list box so that delete operation will be faster.

    Development Environment:

    Windows Forms application with Visual Studio 2015

    Thanks in advance.

    Regards,

    Hari.


    • Edited by GHBHAT Thursday, August 30, 2018 12:44 PM
    Thursday, August 30, 2018 11:30 AM