N
NvrBst
I populate a ListBox with a LogFile that has about (~1000 lines). The
ListBox's datasource is a BindingList<string>. Whenever I add the
elements, with the datasource set, it takes about 2 mins.
I've tried wrapping "Listbox.SuspendLayout()" and
"Listbox.ResumeLayout()" around the for loop (that does the adding)
but it still takes about 2 mins. Only thing I can seem to do is set
the DataSource to null, add to the BindingList and then reset the
DataSource (this way the ListBox is populated in about 1 second or
less)... Which, I think, defeats the purpose of the BindingList?
How do I tell the ListBox (or the BindingList) to temporarly stop
updating its bindings? Then I can just call the ".ResetBindings()"
function after I'm done adding to the BindingList.
Thanks
NB
ListBox's datasource is a BindingList<string>. Whenever I add the
elements, with the datasource set, it takes about 2 mins.
I've tried wrapping "Listbox.SuspendLayout()" and
"Listbox.ResumeLayout()" around the for loop (that does the adding)
but it still takes about 2 mins. Only thing I can seem to do is set
the DataSource to null, add to the BindingList and then reset the
DataSource (this way the ListBox is populated in about 1 second or
less)... Which, I think, defeats the purpose of the BindingList?
How do I tell the ListBox (or the BindingList) to temporarly stop
updating its bindings? Then I can just call the ".ResetBindings()"
function after I'm done adding to the BindingList.
Thanks
NB