I'm trying to add 40 rows in a grid programmaticly like this :
when adding let say 30 rows (nb=30) the grid is extremely slow. Is there something i should do to fasten things up?
I've tried using
| try |
| { |
| this.Cursor = Cursors.WaitCursor; |
| grdSearchResults.SuspendUpdate(); |
| //remove all filters |
| foreach (GridViewDataColumn dc in grdSearchResults.MasterGridViewTemplate.Columns) |
| dc.Filter.StringValue = string.Empty; |
| //add new pax to current manifest |
| for (int i = 0; i < nb; i++) |
| paxList.AddNew(); |
| UpdateScreenState(); |
| grdSearchResults.Rows[paxList.Count - nb].IsCurrent = true; |
| grdSearchResults.Columns[0].IsCurrent = true; |
| grdSearchResults.GridElement.ScrollToRow(0); |
| if (grdSearchResults.CurrentCell != null) |
| ((GridDataCellElement)grdSearchResults.CurrentCell).BeginEdit(); |
| } |
| catch (Exception exc) |
| { |
| ExceptionPolicy.HandleException(exc, "Client Policy"); |
| } |
| finally |
| { |
| this.Cursor = Cursors.Default; |
| grdSearchResults.ResumeUpdate(); |
| } |
when adding let say 30 rows (nb=30) the grid is extremely slow. Is there something i should do to fasten things up?
I've tried using
grdSearchResults.GridElement.BeginUpdate();
instead of SuspendUpdate but the grid throws an argument out of range exception stating that Value is out of range???