|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ComboBoxColumn = SlowwwI 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 Hi Dan,
Have you tried using SuspendLayout/ResumeLayout methods? HTH ... Show quote "Daniel Manes" <danth***@cox.net> wrote in message news:1155855816.929166.241690@i42g2000cwa.googlegroups.com... >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 > 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 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 ... Show quote "Daniel Manes" <danth***@cox.net> wrote in message news:1155921246.851099.176700@b28g2000cwb.googlegroups.com... > 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 > |
|||||||||||||||||||||||