473,797 Members | 2,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ListView Keeps Flickering

I've got a Listview control (Detail mode) that I'm adding rows to on
another thread from a DB query.

The result is about 32,000 rows ans takes a while to finish.

I'm adding the rows like this : lv.Items.Add( lvi );

It seems the entire control is redrawing even though usually the new
rows being added are not visible. I don't remember this being the case
in Win32. Anyway w/ all the flickering going on the LV control is too
hard to read to be useful while the populating occurs and I want to
see if this can be fixed.

Any ideas how?
Nov 16 '05 #1
5 4509
You can either use BeginUpdate() & EndUpdate() around your calls to
Items.Add, or build an array of the items to be added and then add the lot at
once using AddRange().

HTH,
Chris

"Phill" wrote:
I've got a Listview control (Detail mode) that I'm adding rows to on
another thread from a DB query.

The result is about 32,000 rows ans takes a while to finish.

I'm adding the rows like this : lv.Items.Add( lvi );

It seems the entire control is redrawing even though usually the new
rows being added are not visible. I don't remember this being the case
in Win32. Anyway w/ all the flickering going on the LV control is too
hard to read to be useful while the populating occurs and I want to
see if this can be fixed.

Any ideas how?

Nov 16 '05 #2
Phill <wa********@yah oo.com> wrote:
Anyway w/ all the flickering going on the LV control is too
hard to read to be useful while the populating occurs and I want to
see if this can be fixed.


Check out <http://tinyurl.com/5ystr>.
Nov 16 '05 #3
BeginUpdate() is borderline useless.

You will still get flicker and it's not the least bit practical to
have your listview control sit there empty for like 45 seconds while
it populates.

Its rediculous that the control redraws for items that are not in
view. That's just asinine & I'm very surprised the controls behave
this way.

I guess I'm going to end up writing my own.
Nov 16 '05 #4
On 8 Nov 2004 15:13:42 -0800, Phill wrote:
I guess I'm going to end up writing my own.

When you have done it PLEASE make it open source and share it

// Anders
Nov 16 '05 #5
I ran into that same problem which is why I ended up writing my own
listview as well.

On 8 Nov 2004 15:13:42 -0800, wa********@yaho o.com (Phill) wrote:
BeginUpdate( ) is borderline useless.

You will still get flicker and it's not the least bit practical to
have your listview control sit there empty for like 45 seconds while
it populates.

Its rediculous that the control redraws for items that are not in
view. That's just asinine & I'm very surprised the controls behave
this way.

I guess I'm going to end up writing my own.


Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
8868
by: Joaquin Grech | last post by:
Hi I did alot of research on this on the web and msdn and I couldn't find anything. I have a listview showing as a grid (table looking, with rows and columns and no images at all, only text). I get the information to display on the listview from the network and I add items often and stuff. But more than adding items, what worries me is the step of modifying items.
2
4737
by: Anushya devi | last post by:
Hi All I used listview and tried to update it by using Addrange. When the number of items is less, it works fine.. But I need to update nearly 200,000 items and it hangs. Also i need to add images to listview also(This is to list all the items in my inbox, and want to give the user the feel of outlook). Since it hangs for even 1000 items in the inbox, i tried to shift to virtual listview. But virtual listview
9
6389
by: C# Learner | last post by:
Has anyone else noticed ListView's unbearable flickering? I have a project containing a list-view with the following: - View: Details - Columns: 5 The following code causes the list-view to flicker: private void TestListView() {
2
8616
by: John Lee | last post by:
Hi, I have a windows application that uses the listview to display about 50 items in detailed view - 4 columns. The first column is static and other columns will be updated in 100-1000ms - it looks awful when it's running - flickering too much!!! Anyone know how to solve this flickering problem? or how should I deal with this issue? I see some other C++ app can display more than 100 items without any flickering in such as speed. Can...
2
2531
by: John Lee | last post by:
Thanks Jay for your response. I tried your code and it still flickering a lot. To demonstrate it, you can grab a listview, create 3 columns - name, value, timestamp, in form_load event to add 50 items into that listview as Item1 - Item49, add a timer to your windows form, set the timer interval to 100 ms, in the event handler, add the code to update the value and timestamp Random r = new Random(); listView1.BeginUpdate();
5
9527
by: jtalbot_vizible | last post by:
I was looking at the code on codeproject to solve my listview flickering issue. All the references to functions in the rest of my post refer to that code. It's available at http://www.codeproject.com/cs/miscctrl/listviewff.asp?df=100&forumid=14314&select=1488858&msg=1488858 That code didn't solve my problem. I have a ListView (in Details mode) with about 70 rows and 12 columns. It's a stock ticker kind of app. When it first starts, each...
0
1192
by: James | last post by:
Hi all, I have made a derived Listview which can accept the controls as items in it. Controls that we are using are Buttons in each row and implemented Grouping with the help of controls(label on panel) . Coz Inbuilt listview Grouping not supported in OS like window 98. Although I had used Double buffering (SetStyle(ControlStyles.DoubleBuffer, true); .. in my Listview) but still the listview flickers much when we scroll its items. ...
0
1599
by: James | last post by:
Hi all, I have made a derived Listview in C# .net 1.1 framework, which can accept the controls as items in it. Controls that we are using are Buttons in each row and implemented Grouping with the help of controls(label on panel) . Coz Inbuilt listview Grouping not supported in OS like window 98. Although I had used Double buffering (SetStyle(ControlStyles.DoubleBuffer, true); .. in my Listview) but still the listview flickers much...
0
2006
by: IanWright | last post by:
I'm trying to change the cursor that appears on a standard ListView when the cursor appears over an item. However I am getting a flickering effect as the mouse is changed to a finger cursor, and then back to what I asked it to be. I'm trying to isolate this flicker/changing to the hand cursor but can't figure out where it's occuring or how to stop it. To replicate this... 1) Create a form with a ListView on it. 2) Add an image list and...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10468
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10245
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10205
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7559
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.