picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.52k stars 319 forks source link

[WPF] Pressing Enter in GridView moves the selection to the next line #2630

Closed Serg-Norseman closed 4 months ago

Serg-Norseman commented 4 months ago

How can I disable the feature that pressing Enter in a GridView moves the selection to the next row? This functionality greatly interferes with the introduction of another, it really needs to be turned off.

cwensley commented 4 months ago

Something like this should work:

myGridView.KeyDown += (sender, e) => {
  if (!myGridView.IsEditing && e.KeyData == Keys.Enter)
    e.Handled = true;
};
Serg-Norseman commented 4 months ago

Thank you!