Hi,
I am getting the error message as "Cannot access a disposed object.Object name: 'Infragistics.Win.UltraWinGrid.UltraGridCell'.".
the line of code generating such error is
this.CustomerMarkUpGrid.Rows[i].Cells["IsDefault"].Value = true.
Interesting issue is that when ever i try to assign false instead of true there is no any error message. error occurs only when i try to assign true.
I tried to catch this error in CellDataError event of grid, but unfortunately CellDataError event of grid is not fired.
What event is this line of code in?
What is the value of "i" when the error occurs?
You won't get a CellDataError or Error event for something like this because the error has nothing to do with the data. The error indicates that a cell inside a row has been disposed. The only way I can think of that this could possibly happen is if the grid has somehow gotten out of synch with the UI Thread. My best guess is that you are using multiple threads in your application and there's a marshalling problem somewhere.
The event of this line of code is on Cell_Change, the code goes as below
private void CustomerMarkUpGrid_CellChange(object sender, CellEventArgs e) { if (this.CustomerMarkUpGrid.ActiveCell.Column.Key == "IsDefault" && this.CustomerMarkUpGrid.Rows.Count > 0) { int currentIndex = CustomerMarkUpGrid.ActiveCell.Row.Index; bool toSet = Convert.ToBoolean(this.CustomerMarkUpGrid.ActiveCell.Row.Cells["IsDefault"].Text); for (int i = 0; i < this.CustomerMarkUpGrid.Rows.Count; i++) { if (currentIndex == i) { this.CustomerMarkUpGrid.Rows[i].Cells["IsDefault"].Value = toSet;
I still could not figure out why it is giving such error..