InsertRange poor performance

The following line in a custom grid control derived from GridControl is consuming 73% of the time in a critical section of code:

Me.Rows.InsertRange(CInt(RowLocation), 1)

InsertColumn is also very slow. Is there some way to improve performance?




2 Replies

AD Administrator Syncfusion Team October 1, 2008 07:34 PM UTC

Is the InsertRange call being done repeatedly? If so, you might try bracketing your calls with BeginUpdate/EndUpdate to see that makes things faster.

Me.BeginUpdate()

'do all your inserts...
Me.Rows.InsertRange(CInt(RowLocation), 1)
'...
Me.Rows.InsertRange(CInt(RowLocation), 1)
'...

Me.EndUpdate()
Me.Refresh()


Another thing you might try is to set:

OptimizeInsertRemoveCells = True




TM Tim Mostad October 16, 2008 08:33 PM UTC

Both of these made a huge difference in the performance of my app. Thanks!


Loader.
Up arrow icon