How to prevent datagrid enter key goes to next row in silverlight
Thanks in advance.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaganathan BantheswaranPosted Apr 3, 2014, 8:34 AM
You can handle the keydown event as repled, or use command provider like demonstrated here
Shweta LodhaPosted Apr 3, 2014, 8:18 AM
protected override void OnKeyDown(KeyEventArgs e)
{
DataGridCellInfo originalCell = CurrentCell;
base.OnKeyDown(e);
if (e.Key == Key.Enter)
{
// Select cell - don't want to select the next row with Summary Grid as it messes with updates. CurrentCell = originalCell;
SelectedCells.Clear();
SelectedCells.Add(CurrentCell);
} }
More at:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/b7f36f96-e970-4c13-a333-35f20b659c59/datagrid-enterreturn-key-goes-to-next-row?forum=wpf