Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
SetDataBindings Performance
posted

I'm encountering a performance issue when I bind a dataset to a datagrid at runtime. Regardless of the speed of the initial data population, when I issue a "refresh" request, the dataset with the exact same query/results is taking twice as long to bind to the grid. I've read the document in this site that talks about a lot of the WinGrid performance issues and have tried a number of the suggestions with no success.

The logic follows a certain flow:

- separate routine populates a dataset (mygrdxData)

- if there are results, the SetDataBinding is executed to binds that data to the datagrid (see snippet below)

In the first execution the binding process takes about 5 seconds (1000 records with about 60 columns). The second execution takes about 11 seconds (same record, column count and actual data).

Why the doubling of time spent in SetDataBinding on requests subsequest to the first request? What can I do to eliminate this and/or reset grid back to "original state"?

Dim iTick As Integer = GetTickCount

grdx.DataBindings.Clear() : MaxRows = 0
If gfIsArrayFull(mygrdxData) OrElse (Not IsNothing(mygrdxData) AndAlso mygrdxData.Tables.Count > 0 AndAlso mygrdxData.Tables(0).Columns.Count > 0) Then
 'grdx.DisplayLayout.MaxBandDepth = 1 : grdx.SyncWithCurrencyManager = False
 grdx.SetDataBinding(mygrdxData, mygrdxData.Tables(0).TableName, False)
 MaxRows = mygrdxData.Tables(0).Rows.Count
End If
Debug.WriteLine("SetDataBinding(ms): " & CStr(GetTickCount - iTick))

Parents Reply Children