Hi,
I have attached a sample application which shows the issue. To replicate:
1. use v10.3 (2145).
2. load solution in VS2010, run it
3. in the left grid, edit either columns cell value, while still in edit mode,
4. click on the right column chooser, onto 'column 0'. the error will show.
I think the issue is that the column chooser has cached the columns from the grid, even if the grids datasource is set to null, the column chooser still thinks the columns exist. So eventually you get this error.
In my application, I am not setting the datasource to null in the exiteditmode event ( for ease of replicating it for you I just set the datasource to null in the sample code). In my code, I am rebuilding the datasource, but the result is the same error. I think, it is because at some point, the columns are changed, so they are disposed, but is still accessed by the column chooser in the mouse down event
I've found no way to try to avoid this issue without changing the infragistics code. Can you tell me if there is way to workaround this?
the error call stack is:
************** Exception Text **************System.ObjectDisposedException: Cannot access a disposed object.Object name: 'Infragistics.Win.UltraWinGrid.UltraGridColumn'. at Infragistics.Shared.DisposableObject.VerifyNotDisposed() at Infragistics.Shared.SubObjectBase.NotifyPropChange(PropChangeInfo trigger) at Infragistics.Win.UltraWinGrid.UltraGridColumn.InternalSetSortIndicator(SortIndicator sortIdicator) at Infragistics.Win.UltraWinGrid.SortedColumnsCollection.InternalClear() at Infragistics.Win.UltraWinGrid.SortedColumnsCollection.ApplyNewSortedColumns(SortedColumnsCollection newSortedColumns, Boolean groupBy) at Infragistics.Win.UltraWinGrid.SortedColumnsCollection.ProcessNewSortedColumnsHelper(SortedColumnsCollection newSortedColumns, Boolean fireEvents, Boolean groupBy) at Infragistics.Win.UltraWinGrid.SortedColumnsCollection.SetSortedColumn(UltraGridColumn column, SortIndicator sortIndicator, Boolean groupBy, Boolean clearExistingNonGroupByColumns, Boolean fireEvents) at Infragistics.Win.UltraWinGrid.UltraGridBand.SetSortedColumn(UltraGridColumn column, SortIndicator sortIndicator, Boolean clearExisting) at Infragistics.Win.UltraWinGrid.UltraGridColumn.ClickSortIndicator() at Infragistics.Win.UltraWinGrid.HeaderUIElement.EndDragHelper(Boolean cancelled) at Infragistics.Win.UltraWinGrid.HeaderUIElement.OnDispose() at Infragistics.Shared.DisposableObject.Dispose() at Infragistics.Win.UIElement.OnDispose() at Infragistics.Shared.DisposableObject.Dispose() at Infragistics.Win.UIElement.OnDispose() at Infragistics.Win.UltraWinGrid.RowUIElementBase.OnDispose() at Infragistics.Shared.DisposableObject.Dispose() at Infragistics.Win.UIElementsCollection.DisposeElements() at Infragistics.Win.UltraWinGrid.RowColRegionIntersectionUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.RowColRegionIntersectionUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(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)
thanks. I found a workaround, please close this.
Hello Greycon,
I am writing to you regarding Development issue with id of 110588, our developers have researched this for you and the reason of this issue is setting of DataSource of UltraGrid in AfterExitEditMode event. We strongly advise the customer against doing this. It is certain to cause all sorts of problems and errors.
In this particular sample, the grid is exiting edit mode when you click on the ColumnChooser to hide the column you just edited. So the ColumnChooser is being clicked and while it's in the middle of processing that click, the column it was about to try to hide it being removed from the grid.
Like a workaround I could suggest you to implement a wrapper class, where to rest DataSourse of your UltraGrid, in mouse click event of UltraCoulunChoose, where column chooser has processed that click, and to avoid this exception. I have implement my idea in you sample, please run the sample and let me know if it works for you.
Please let me know if you have any further questions.
Any news on likely eta on fixing this?
Normal 0 false false false EN-US ZH-TW AR-SA
Hello,
I was able to reproduce this issue on my end, so I have opened a support ticket with id CAS-89991-ZZP60M, in order to research this issue further for you. As soon as I have information for you, I will update you via the mentioned support thicket.
Thank you for using Infragistics Components.