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 Alan,
I am very glad that the custom approach with the dispatcher has manage to solve your issue. Please, in case of other concerns regarding this matter, do not hesitate to contact us.
Thank you for choosing Infragistics components.
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
No, I don't think so. As a post mortum on this, I was not able to get this functionality to work without using the Dispatcher. It is almost as if the XamGrid depends on its behavior.
Hello,
I am checking if this is still an issue for you.
If you require any further assistance please do not hesitate to ask.
Infragistics
Thank you for your answer.
I have managed to find a custom approach deals with your issue:
In ActiveCellChanged handler, check if the second cell is the active one and if it is so, activate the third one and put the grid in edit mode:
void xamGrid1_ActiveCellChanged(object sender, EventArgs e)
{
if (xamGrid1.ActiveCell.Column.DisplayNameResolved == "02")
xamGrid1.ActiveCell = xamGrid1.ActiveCell.Row.Cells["03"];
xamGrid1.EnterEditMode();
}
As to your question about the dispatcher’s - its function is to deal with the work items of a thread and I am using it to postpone the execution of the given Action. For more information please refer to the following link:
http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.aspx
This just seems totally illogical. The concept that I can be in edit mode in one cell but active in another one, maybe you can call it as expected, but it makes no sense to me.
Can you explain this syntax as well? You might have solved another issue I am having:
Dispatcher.BeginInvoke(new Action(() => { xamGrid1.EnterEditMode(); }));
What is Dispatcher.BeginInvoke all about?