ComboBoxColumn = Slowww

D

Daniel Manes

I have a DataGridView with about 450 records. There are five columns:
three ComboBoxColumns and two TextBoxColumns. When loading the Form,
even after all the BindingSources are filled, it still takes a long
time before the data shows (and I'm running on a pretty fast machine).
Also, if you try to re-sort one of the columns, it sits there for a
good long while before it redraws the table.

So, I was thinking, if it's possible, maybe I should just use standard
columns (TextBoxColumns) and then use event handlers to insert and
remove ComboBoxes on the fly on an as-needed basis. This seems like it
would speed thinks up a lot but I can't figure out how to change an
individual cell's EditingControl from a TextBox to a ComboBox.

Please advise.

Thanks in advance,

-Dan
 
D

Daniel Manes

Hi Emby,

I must confess I haven't tried SuspendLayout/ResumeLayout, but I guess
I'm not sure what you have in mind. I think the problem is that the
layout itself is slow. Not to be a smart ass, but how would stopping
and restarting a slow process make it any faster? :)

Thanks,

-Dan
 
E

Emby

Dan,

I don't know how applicable this technique is to your issue, but it may be
that the control is slow adding data because it is updating it's UI after
every row is added. You can "freeze" UI updating with SuspendLayout, add the
data and then ResumeLayout to avoid all the UI updates in between.

Even with a fast machine, a sub-par video driver could potentially bring you
to a crawl with all those screen updates.

HTH ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top