pekcheng
pekcheng

Reputation: 364

VB datagrid - design bind - dataset table adapter SLOW at form A; FAST at form B

I'm facing a problem here which is I did a design time binding on datagrid to a dataset table adapter.

so then there will be an auto generated vb.code in the FormLoad function.

Eg:

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'ABC_Dataset.abc' table. You can move, or remove it, as needed.
    Me.abcTableAdapter.Fill(Me.ABC_Dataset.abc)

End Sub

I have 2 individual forms (form A n form B). However, with the same line of code as shown above, it only took 1 sec to load in Form A but 4-5 secs to load in Form B?

FYI: Form A has only a datagridview control, n Form B has a datagridview, few buttons around, some combo boxes. Would it be the factor causing it to be slow?

Kindly advise :(

Thanks

Upvotes: 2

Views: 596

Answers (1)

Yaobin Then
Yaobin Then

Reputation: 2832

Disable auto resizing for column resizing, the cells are being resized everytime there's new row added during loading.

Upvotes: 2

Related Questions