I think that I smell a bug. Ok, kere is the scenario. Create a grid with three or more columns on it. Make the second column readonly. On the cellexitededitmode event check to see if you are exiting editing of the first cell. If so, activate editmode on the third cell. Begin typing in the third cell.
Meanwhile on the grid's keydown event, check grid.ActiveCell.Column.Key property and notice that is the second column.
wha? How can the second column be active and I am editing the third column and the second column is marked readonly?
Hello,
I have been looking through your issue and I went through your steps. I have created a grid with three columns and the second one is read only. I have added the KeyDown and the CellExitedEditMode events. Here what I have put in my CellExitedEditMode
if (e.Cell.Column.Key == "First") { xamGrid1.ActiveCell = xamGrid1.Rows[0].Cells[2];
Dispatcher.BeginInvoke(new Action(() => { xamGrid1.EnterEditMode(); })); }
And this is my key down event: private void xamGrid1_KeyDown(object sender, KeyEventArgs e) { string key = xamGrid1.ActiveCell.Column.Key; }
What is happening is that the grid acts as expected – if I steal the focus from the first column’s cell, by clicking on some other control for example, the active cell is the third one and it is in edit mode as well. However if we steal the focus by pressing tab, the third cells enters edit mode, but that does not mean that cells from the second read only column cannot be the active ones since the focus has been moved to them. The read only property prevents the cells from entering edit mode, not from being the active cells.
Please let me know if my answer meets your requirements or I have misunderstand you at some point.
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support