Home All Groups Group Topic Archive Search About
Author
29 Jun 2005 11:29 AM
Steph.

Hi !



I use a ListView in a form to display Data from an SQL db.



My problem is that I can fill the listview in less than a second when I show the form AFTER filling the listview, but I take 35 seconds if I show the form BEFORE filling the listview !!!



Yes I call ListView's BeginUpdate()/EndUpdate() methods, I tried with hiding the ListView before filling it, I tried Suspend/resume Layout,.  nothing works, I still have to wait 35 seconds.. And the only difference is that the form is shown before or after filling the listview !



  Does anybody have an idea about that problem ???



  Thanks for any help  !



Steph.

Author
29 Jun 2005 12:42 PM
Michael J. Salamone
How many items are we talking about here?  And, is there any sorting going
on?  If there is sorting, any chance the sorting is working any differently?
Quick test would be to turn sorting off and see if the timing changes.

You might also put Spy++ on it and see if there is anything unusual /
unexpected.


I don't suppose you've made it a virtual listview?

--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com


"Steph." <st***@nomail.com> wrote in message
news:uCIpp2JfFHA.1444@TK2MSFTNGP10.phx.gbl...
Hi !

I use a ListView in a form to display Data from an SQL db.

My problem is that I can fill the listview in less than a second when I
show the form AFTER filling the listview, but I take 35 seconds if I show
the form BEFORE filling the listview !!!

Yes I call ListView's BeginUpdate()/EndUpdate() methods, I tried with
hiding the ListView before filling it, I tried Suspend/resume Layout,.
nothing works, I still have to wait 35 seconds.. And the only difference is
that the form is shown before or after filling the listview !

  Does anybody have an idea about that problem ???

  Thanks for any help  !

Steph.
Are all your drivers up to date? click for free checkup

Author
30 Jun 2005 8:09 AM
Steph.
No

HI,

  Thanks for your interest !

There is about 2800 Items.  No sorting of any kind...   no virtual ListView...
The only difference is that the form containing the listview is shown before or after filling the listview...   If I fill fill the listview before showing the form I put the 2800 items in the listview in a second... 35-40 second if I do that after showing the form...

  Steph.


  "Michael J. Salamone" <mikesa#at#entrek#dot#com> wrote in message news:eWJcxfKfFHA.3916@tk2msftngp13.phx.gbl...
  How many items are we talking about here?  And, is there any sorting going
  on?  If there is sorting, any chance the sorting is working any differently?
  Quick test would be to turn sorting off and see if the timing changes.

  You might also put Spy++ on it and see if there is anything unusual /
  unexpected.


  I don't suppose you've made it a virtual listview?

  --
  Michael Salamone [eMVP]
  Entrek Software, Inc.
  www.entrek.com


  "Steph." <st***@nomail.com> wrote in message
  news:uCIpp2JfFHA.1444@TK2MSFTNGP10.phx.gbl...
  Hi !

  I use a ListView in a form to display Data from an SQL db.

   My problem is that I can fill the listview in less than a second when I
  show the form AFTER filling the listview, but I take 35 seconds if I show
  the form BEFORE filling the listview !!!

   Yes I call ListView's BeginUpdate()/EndUpdate() methods, I tried with
  hiding the ListView before filling it, I tried Suspend/resume Layout,.
  nothing works, I still have to wait 35 seconds.. And the only difference is
  that the form is shown before or after filling the listview !

    Does anybody have an idea about that problem ???

    Thanks for any help  !

   Steph.
Author
30 Jun 2005 9:40 AM
Steph.
More info....



  The problem seems to be that it take much more time (about 40 times more) to add items to the ListView when its Parent property is set, or has been set at least once.



So far, the solution to the problem is building the ListView programmatically, fill it, and then set its parent property. When I want to change the data in the Listview, I dispose it, create a new one, fill it then I set its parent property..



  Steph.


  "Michael J. Salamone" <mikesa#at#entrek#dot#com> wrote in message news:eWJcxfKfFHA.3916@tk2msftngp13.phx.gbl...
  How many items are we talking about here?  And, is there any sorting going
  on?  If there is sorting, any chance the sorting is working any differently?
  Quick test would be to turn sorting off and see if the timing changes.

  You might also put Spy++ on it and see if there is anything unusual /
  unexpected.


  I don't suppose you've made it a virtual listview?

  --
  Michael Salamone [eMVP]
  Entrek Software, Inc.
  www.entrek.com


  "Steph." <st***@nomail.com> wrote in message
  news:uCIpp2JfFHA.1444@TK2MSFTNGP10.phx.gbl...
  Hi !

  I use a ListView in a form to display Data from an SQL db.

   My problem is that I can fill the listview in less than a second when I
  show the form AFTER filling the listview, but I take 35 seconds if I show
  the form BEFORE filling the listview !!!

   Yes I call ListView's BeginUpdate()/EndUpdate() methods, I tried with
  hiding the ListView before filling it, I tried Suspend/resume Layout,.
  nothing works, I still have to wait 35 seconds.. And the only difference is
  that the form is shown before or after filling the listview !

    Does anybody have an idea about that problem ???

    Thanks for any help  !

   Steph.

Bookmark and Share