anonymous
Wed Jun 02 11:51:02 CDT 2004
Thank you for your suggestion. But this did not help. The exact code that I am executing is
cardholderList.BeginUpdate()
resetProgressBar.Minimum = 0
resetProgressBar.Maximum = cardholderList.Items.Count
resetProgressBar.Step = 1
resetProgressBar.Value = 0
foreach(ListViewItem item in cardholderList.Items
item.Selected = true
item.ImageIndex = 1
resetProgressBar.PerformStep()
cardholderList.EndUpdate()
I have tried it with and without the progress bar. It seems to take equally long
Kevi
----- Herfried K. Wagner [MVP] wrote: ----
* =?Utf-8?B?S2V2aW4gQnVydG9u?= <anonymous@discussions.microsoft.com> scripsit
> I have a ListView that I am showing in 'Detail' mode. The lis
> contains about 740 items and I have a button that tries to go throug
> all items in the list and select them and change the image icon. Thi
> seems to take over a minute or two just to do something like
>> foreach(ListViewItem item in listView.Items
>
> item.Selected = true
> item.ImageIndex = 1
>
>> Does anyone have any suggestions on how to speed this up? I would hat
> to guess how long it would take if I had 7000 items in the list. What i
> taking so long? I have tried to suspend the layout as is done during th
> Windows initialization but this did not seem to have any effect
Have a look at the control's 'BeginUpdate' and 'EndUpdate' methods
'SuspendLayout' doesn't have any influence in this case because n
layouting (repositioning of controls) is done
--
Herfried K. Wagner [MVP
<URL:
http://dotnet.mvps.org/>