Fastest way to iterate rows

What methods should I call to iterate through rows and cell values so it would fire the fewest events etc... for the fastest iteration

5 Replies

ST stanleyj Syncfusion Team January 14, 2006 08:40 AM UTC

Hi Va, I am not sure what iteration methods you are looking for. Please refer this thread and see if that is related to your need. http://www.syncfusion.com/support/forums/message.aspx?MessageID=16755 Also refer this sample that is shipped. Syncfusion\Essential Studio\4.1.0.10\windows\Grid.Windows\Samples\In Depth\GridPopulationSample(also available in earlier versions) Check out Invalidate and Refresh methods. Regards, Stanley


VA va January 14, 2006 11:09 PM UTC

Sorry - I was unclear. I was wondering if calling the same functions through GridControl.Model instead of GridControl (like HideRows[], as well as Model.Data etc..) is faster because it may not fire events?


ST stanleyj Syncfusion Team January 17, 2006 05:56 AM UTC

Hi Va, You can call the CurrentCell.SuspendEvents and SuspendChangeEvents before the routines. It will prevent CurrentCell events. this.gridControl1.CurrentCell.SuspendEvents(); this.gridControl1.SuspendChangeEvents(); this.gridControl1.ResumeChangeEvents(); this.gridControl1.CurrentCell.ResumeEvents(); You can directly access the GridData object instead of using an indexer on the grid. This will avoid events and probably be a factor of 5 - 10 times faster. Please refer this thread for more details. Best Regards, Stanley


VA va January 18, 2006 12:44 PM UTC

Right. But if I use the model to also all the Model.Functions... do all counterpart Model.Functions that have the same name as GridControl.Functions ALSO not call the events?


ST stanleyj Syncfusion Team January 24, 2006 04:08 PM UTC

Hi Va, If HideRows is making things slower then try grid.RowHeights.SetRange method. Grid and Grid.Model has to be the same. Regards, Stanley

Loader.
Up arrow icon