Double Buffering ListView Control

G

Guest

I am using the listview control to display data recieved in a real time
fashion (speed is an issue, and it is faster than the datagrid). My question
is if anyone know's of a good approach on how to implement double buffering
on the control in order to remove the screen flicker. Everything that I have
googled is coming up for the .NET Framework and will not work for us.

Any help would be greatly appreciated.

Tim
 
T

Tim Wilson

If you're adding a lot of data in a short period of time then you may
consider the solution linked below to see if this will reduce the flicker.
http://blog.opennetcf.org/afeinman/PermaLink,guid,9305a1d9-e24e-4310-89e2-f80808076a37.aspx

Even if you did implement a double buffer method, then, depending on how
fast your data is coming in, you may still be updating the controls
appearance so frequently that it will produce a noticeable flicker to the
end user. If there is any possible way that the data can be stored and
updated, let's say, every 5 seconds, then you can use the technique to turn
off updating, add the items in the storage buffer to the control, and then
turn updating back on to display the new items to the user. Just a thought.
 
I

Ilya Tumanov [MS]

Are you using BeginUpdate()/EndUpdate() to update list view?



Also, DataGrid might be faster if you have more than 10-20 records to
display.

It might be possible to update only changed records with grid (depends on
the data source).



Best regards,



Ilya


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Thanks for the reply.

I have tried the Begin/End Update and without any success prior to my post.
I believe the speed at which the data is comming in, about once every 1/6 of
a second may be causing trouble. The problem is that the users want to be
able to see this data as it is available, so I believe storing the data may
be a problem.

Do you have any other suggestions on how to display the data (maybe a
different control?). I was originally using the data grid to do this work,
but ended up being too slow (in terms of displaying data to the user).

I did find this article,
http://www.codeproject.com/cs/miscctrl/listviewff.asp, and its WndProc
Technique seems promising, but I have been unable to port the code over to
the .Net CF.

Tim
 
T

Tim Wilson

Doh! Until Ilya mentioned it below, I totally forgot that the CF ListView is
one control that does have the BeginUpdate and EndUpdate methods
implemented. This is essentially what the information in Alex's blog entry,
the link that I posted, is talking about. So just use those methods instead,
if necessary.
 
T

Tim Wilson

What type of data is the user observing through the ListView? Can the user
actually read incoming data at that rate?

I imagine that one of the major hurdles that you are encountering while
porting the code in the article is that lack of the WndProc method to
override. If you wish to further pursue that technique, then you might want
to look into the "Creating a "pseudo" window procedure using
OpenNETCF.ApplicationEx class" blog entry as one way to gain access to
messages.
http://blog.opennetcf.org/ayakhnin/PermaLink.aspx?guid=9A05B2DC-C79F-4CD8-AF17-AA485FADA5C7
 
G

Guest

The data that is being recieved and displayed to the user is data (as a
string) from an automotive vehicle's pcm (such as rpm, coolant temp, etc.).
Can the user read the data at this rate? Most Likely. Is it needed to be this
fast? Short answer, yes. They like the responsiveness and see speed as a
issue when using this application in conjuction with their vehicle.

The program sort of works as follows:

1. Request to the car's computer for data
2. Vehicle Replies with data
3. Data is sent via thread pool for formatting and calculations
4. Displays in listview. <-- This Guy is the problem

Thanks for the link to the article, I read that and see what if that
provides any insight.

Martin,

Thanks for the link as well, I will look into that and see if it works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top