in AfterCellUpdate, I check which column was updated (e.cell.column.index) then and if it was the first column, I edit 2 other cells based on the value of a certain column.
To set the values of the other 2 cells, I'm using
e.cell.row.cells(3).value = myvalue1
e.cell.row.cells(4).value = myvalue2
I get an error on the second line indicating that "Key not found : Parameter name: key" not sure why this happens, the first line works fine. I tried replacing the indexes with string keys and get the same results. Shouldn't I be able to access all the cells from this event?
Is there anything that might cause this to give me this error?
Hi,
Are these columns unbound columns? Perhaps this code is getting called before the unbound column has been created? Maybe you can check e.Cell.Row.Cells.Count and see how many columns actually exist at the time the error occurs.
These are bound columns, and it looks like the count is correct just before setting hte value.
strange thing is that the cell right before it works, but editing the second cell causes this error.
Are you sure the exception is occuring right on that line of code? Maybe this code is causing an event to fire and so the exception is not really where it appears to be. You might try setting the VS IDE to break on all run-time exceptions just to be sure.
Also, are you sure this code isn't causing recursion? You are setting the Value of a cell inside the AfterCellChanged, so you should be careful that the code isn't causing the event to re-fire.
If none of that helps, I recommend submitting the issue to Infragistics Developer Support along with a sample demonstrating the issue so they can check it out.
Submit a Support Issue
How do you prevent the cell from refiring after the first aftercellupdate?