473,395 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How best to view huge amounts of text?

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
2 1548
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Mullins | last post by:
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...
3
by: Ryan | last post by:
Hello, I am trying to create a view that shows the following Field1: Sum of Amounts from Table A Field2: Count of Amounts from Table A Field3: Sum of of Amounts from Table B Field4: Count...
6
by: No Spam Man | last post by:
Hi, I am not a programmer and in the past have only created very simple, flat file databases. Although I'm a newbie, I think I could probably figure out basic Boolean logic and financial...
16
by: Rex | last post by:
Hi All - I have a question that I think MIGHT be of interest to a number of us developers. I am somewhat new to VIsual Studio 2005 but not new to VB. I am looking for ideas about quick and...
10
by: rAinDeEr | last post by:
Hi, I am trying to create around 70 tablespaces for around 100 tables.. Am using DB2 UDB 8.2 in Linux environment... This is one i generated through Control centre.... CREATE REGULAR...
20
by: Joe | last post by:
Is any one charting packing considered to be the "best"? We've used ChartFX but wasn't too happy about the way data had to be populated along with some other issues which slip my mind right now and...
13
by: Steven Bethard | last post by:
Jean-Paul Calderone <exarkun@divmod.comwrote: Interesting. Could you give a few illustrations of this? (I didn't run into the same problem at all, so I'm curious.) Steve
29
by: calvert4rent | last post by:
I need to some sort of data type that will hold a listing of ID's and their counts/frequency. As I do some processing I get an ID back which I need to store and keep an accurate count for how many...
16
by: pereges | last post by:
ok so i have written a program in C where I am dealing with huge data(millions and lots of iterations involved) and for some reason the screen tends to freeze and I get no output every time I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.