I have XamGrid control on my screen. I would like it to activate first cell of AddNewRow row and enter edit mode up on receiving focus when I navigate to it.
I’ve tried this solution but it does not work:
XamGridRowsManager Manager = new XamGridRowsManager(this.localGrid); this.localGrid.EnterEditMode(Manager.AddNewRowTop);
Hi,
I believe you will need to use the GotFocus event and then determine if it your responding to the Tab key. At that point you will need to get the AddNewRowTop and set the active cell.
private void LayoutRoot_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Tab)
Row rw = ((RowsManager)this.xamGrid1.Rows[0].Manager).AddNewRowTop;
rw.Cells[0].IsActive = true;
}
Thanks for your update.
I will do some research and update you by the end of the day tomorrow.
I'll try to explain what I need: I have a screen with some controls on it. I am navigating through this screen using Tab key. Going from one control to the next. When I reach grid, it activates first cell of a first row. Instead I need it to activate first cell of AddNewRow row and enter edit mode. This whole thing should happened without any use of the mouse.
Hi Darrell,
Yes I used your xaml and created a sample. I’ll attach my sample to the thread.
Perhaps I do not understand the behavior you are expecting or the steps you are taking.
When I click on the AddRow the initial cell in the new row is activated. If I click out of the xamGrid and then click F2 or Enter, the first cell in the new AddRow is placed back in edit mode.
I added some events to try to confirm if the cell was entering edit mode, which it appears to be doing.
Please explain the steps you are taking and the behavior you are expecting. I still feel like I’m not understanding your questions.
Yes, the property is set but it makes no difference.