C
Chris Mullins
I'm building a GUI that needs to be able to view a large amount of text
arranged in rows. Large being anywhere from a few hundred lines through a
few hundred thousand. I need a way to "cap" the max number of rows, so that
old rows are discarded in favor of new rows if the limit is reached.
My use case is very similar to that of the SQL Profiler GUI - I'm going to
be receiving a large amount of data from a server that I want to display.
I'm fine defining a "window" on the data, or a max number of rows on the
control (say 200K) and throw out old data as the new data comes in.
I started out with a List View control, and appended list view items to the
beginning, and deleted items from the end. This worked fairly well, but
would have very strange behavior on occasion. It would, on a not infrequent
basis, hang the entire app-domain, including the VS.NET debugger. Very, very
frustrating.
I then moved on to a DataGrid bound to a typed dataset. I manage the rows in
the dataset and discard old rows, and only display "new" rows. This works
alright, but has serious performance issues. I haven't tried using the data
grid in "unbound" mode yet.
I am receiving data from the server on a background thread - so this gives
me some leeway to massage data prior to marshalling over to the GUI thread
and updating the control. This allows me to queue updates so that I only
have to paint the GUI every few seconds, rather than each time a new data
chunk arrives.
I'm pretty much at a loss to how to do this with reasonable performance. I
am willing to spend money for a 3rd party control, so long as it's royalty
free.
arranged in rows. Large being anywhere from a few hundred lines through a
few hundred thousand. I need a way to "cap" the max number of rows, so that
old rows are discarded in favor of new rows if the limit is reached.
My use case is very similar to that of the SQL Profiler GUI - I'm going to
be receiving a large amount of data from a server that I want to display.
I'm fine defining a "window" on the data, or a max number of rows on the
control (say 200K) and throw out old data as the new data comes in.
I started out with a List View control, and appended list view items to the
beginning, and deleted items from the end. This worked fairly well, but
would have very strange behavior on occasion. It would, on a not infrequent
basis, hang the entire app-domain, including the VS.NET debugger. Very, very
frustrating.
I then moved on to a DataGrid bound to a typed dataset. I manage the rows in
the dataset and discard old rows, and only display "new" rows. This works
alright, but has serious performance issues. I haven't tried using the data
grid in "unbound" mode yet.
I am receiving data from the server on a background thread - so this gives
me some leeway to massage data prior to marshalling over to the GUI thread
and updating the control. This allows me to queue updates so that I only
have to paint the GUI every few seconds, rather than each time a new data
chunk arrives.
I'm pretty much at a loss to how to do this with reasonable performance. I
am willing to spend money for a 3rd party control, so long as it's royalty
free.