We are trying to use the keyboard in a datagrid
specifically we want the user to be able to use a key to
1) mark a row with specific data
2) go to the next row
in order to do this we added an onkey_up event as follows
var pressedKey = args.Key;
int i = 0;
if (pressedKey==" ")
{
var selectedRows = await this.iboGrid.GetSelectedRecordsAsync();
if (selectedRows.Count() == 0 || selectedRows.Count() > 1)
{
selectedOffer = null;
}
else
{
selectedOffer = selectedRows.FirstOrDefault();
selectedOffer.isSelected = true; // mark row data
var idx = await iboGrid.GetRowIndexByPrimaryKeyAsync(selectedOffer.id);
await iboGrid.SelectRowAsync(idx + 1);
}
}
This seems to work. the row gets modified and the selection moves to the next row but when hitting the space bar again the selection moves back to the previous row and then jumps to the n