By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,514 Members | 1,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,514 IT Pros & Developers. It's quick & easy.

How best to view huge amounts of text?

P: n/a
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.

--
Chris Mullins
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I would say first write the incoming data to a file. Using datagrid just
keepdisplaying the window into the file that the user is interested. If
fresh data is the priority keep the datagrid topped.

"Chris Mullins" <cm******@yahoo.com> wrote in message
news:eN**************@TK2MSFTNGP12.phx.gbl...
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.

--
Chris Mullins

Jul 21 '05 #2

P: n/a
There's no good way to keep a datagrid "topped" that I know of. All the ways
that I've tried have resulted in re-rendering the entire datagrid, which
with a large number of records in there, is not a good solution. When I
benchmarked this using the DevPartner Profiler for .NET is was waaaaaaaay
slow.

Plus this approach has the drawback of needing quite a bit in the way of
additional resources - I've got to write the data to a file, read it back,
index into it properly, etc. I don't think this approach will meet the
performance requirements that I'm looking to meet.

Possabilities such as a pure memory mapped file are there, but they seem
like hacks.

The list view is a great answer, except for the fact that it crashes. A Text
Box would be fine, if it had an "AppendLine".

--
Chris

"Rajesh.V" <Ra***********@hotmail.com> wrote in message
news:eJ****************@TK2MSFTNGP12.phx.gbl...
I would say first write the incoming data to a file. Using datagrid just
keepdisplaying the window into the file that the user is interested. If
fresh data is the priority keep the datagrid topped.

"Chris Mullins" <cm******@yahoo.com> wrote in message
news:eN**************@TK2MSFTNGP12.phx.gbl...
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.

--
Chris Mullins


Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.