Hi, I have a DataView binding to a grid.
grid.DataSource = myDataView.
When I add new rows into this dataview, the grid does update correctly.
DataRowView drv = myDataView.AddNew() drv.BeginEdit() drv[myCol] = 0; drv.EndEdit()
DataRowView drv = myDataView.AddNew()
drv.BeginEdit()
drv[myCol] = 0;
drv.EndEdit()
The problem is, when one of the grid column is sorted (by a single click on the grid column header), the grid crashes out when new data rows are added in. The call stack is coming from the UltraGrid itself. Can you help why the sorting causes this crash?? Why, without sorting the grid column first, does it work fine but crashes out after one column is sorted??
The call stack is as below:
System.IndexOutOfRangeException: Index was outside the bounds of the array. at Infragistics.Shared.SparseArray.ValidateIndex(Int32 index) at Infragistics.Shared.SparseArray.GetItem(Int32 index, ICreateItemCallback createItemCallback) at Infragistics.Shared.SparseArray.get_Item(Int32 index) at Infragistics.Win.UltraWinGrid.RowsCollection.RowsSparseArray.GetItem(Int32 index, Boolean create, Boolean calledFromScrollCountManagerSparseArray, Boolean& newRowCreated) at Infragistics.Win.UltraWinGrid.RowsCollection.RowsSparseArray.ToArray(Boolean create) at Infragistics.Win.UltraWinGrid.RowsCollection.InitNonGroupByRows(IList fireInitializeRowOnTheseRows) at Infragistics.Win.UltraWinGrid.RowsCollection.SyncRowsHelper(IList boundList) at Infragistics.Win.UltraWinGrid.RowsCollection.SyncRows() at Infragistics.Win.UltraWinGrid.RowsCollection.VerifyGroupByVersionHelper() at Infragistics.Win.UltraWinGrid.UltraGridRow.get_ParentRow() at Infragistics.Win.UltraWinGrid.UltraGridRow.get_HiddenResolved() at Infragistics.Win.UltraWinGrid.RowScrollRegion.get_FirstRow() at Infragistics.Win.UltraWinGrid.RowScrollRegion.GetMaxScrollPosition(Boolean scrollToFill) at Infragistics.Win.UltraWinGrid.RowScrollRegion.EnsureScrollRegionFilled(Boolean calledFromRegenerateVisibleRows) at Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(Boolean resetScrollInfo) at Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(ScrollbarVisibility assumeColScrollbarsVisible) at Infragistics.Win.UltraWinGrid.RowScrollRegion.PositionScrollbar(Boolean resetScrollInfo) at Infragistics.Win.UltraWinGrid.ScrollRegionBase.SetOriginAndExtent(Int32 origin, Int32 extent) at Infragistics.Win.UltraWinGrid.RowScrollRegion.SetOriginAndExtent(Int32 origin, Int32 extent) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.ResizeRowScrollRegions() at Infragistics.Win.UltraWinGrid.DataAreaUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.set_Rect(Rectangle value) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics) at Infragistics.Win.UIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe) at Infragistics.Win.UltraWinGrid.UltraGrid.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Hi,
Do you have the latest Hot Fix?
If not, I recommend getting it from the Infragistics Web site and see if it helps.
If that does not help, you should submit a small sample project to Infragistics Developer Support which demonstrates the error so they can check it out. Get Help
Hi Mike,
Could you please tell us which Hot Fix or service release fixed this bug? We currently use Infragistics.Win.UltraWInGrid v7.2.20072.1078.
There's no way to know for sure without trying it out. You should get the latest service release and see if the problem is resolved. According to my records, the last service release of NetAdvantage v7.2 was build 1083, released on November 18th, 2008. So there is a slightly newer one than the version you are using.
How to get the latest service release - Infragistics Community