|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ListView_Problem_/Mystery.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. 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? "Steph." <st***@nomail.com> wrote in message I use a ListView in a form to display Data from an SQL db.news:uCIpp2JfFHA.1444@TK2MSFTNGP10.phx.gbl... Hi ! 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. 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 I use a ListView in a form to display Data from an SQL db.news:uCIpp2JfFHA.1444@TK2MSFTNGP10.phx.gbl... Hi ! 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. 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 I use a ListView in a form to display Data from an SQL db.news:uCIpp2JfFHA.1444@TK2MSFTNGP10.phx.gbl... Hi ! 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.
Other interesting topics
Inherited Menus and Modifiers
All MDI forms repaint when one is resized Dialog ghost left on window Editing hyperlinks in RichTextBox Control in C#.NET GridView Exception: reentrant call to the SetCurrentCellAddressCore function Screen.PrimaryScreen.WorkingArea question TreeView with XP themes error Pencil icon in the datagrid Search combobox attaced to datagrid Manually adding usercontrol to panel on form |
|||||||||||||||||||||||