Pressing <Enter> Key While Editing WPF DataGrid
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
_This issue has been moved from [a ticket on Developer Community](https://developercommunity2.visualstudio.com/t/Pressing-Enter-Key-While-Editing-WPF-D/768729)._
---
I am not the only person complaing about this bug (I guess). At pressing Enter key on any editable cell of WPF DataGrid it generates errors such as ((ArgumentOutOfRangeException in DataGridCellsPanel.BringIndexIntoView)). To overcome this problem I found a work around solution on the net and I used it which is working fine for me. The solution is as:
private void Dg_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return)
{
e.Handled = true;
Dg.CommitEdit();
}
}
I think this is a BUG and its the time to fix.
---
### Original Comments
#### Feedback Bot on 10/9/2019, 05:53 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
#### Hash Soft on 10/10/2019, 01:41 AM:
Even with the work around solution I mentioned in my last message, I got the following error:
System.ArgumentNullException: 'Value cannot be null. Parameter name: element'
#### Feedback Bot on 11/15/2019, 09:31 AM:
I have detected that for the last 35 days, this issue didn't have much product team activity and a very small amount of new votes or comments. Based on this, its severity, and affected area, it’s my experience that this issue is very unlikely to be fixed.
---
### Original Solutions
#### Hash Soft solved on 10/10/2019, 01:40 AM, 0 votes:
Even with the work around solution, I got the following error:
System.ArgumentNullException: 'Value cannot be null. Parameter name: element'
#### Hash Soft solved on 11/16/2019, 04:41 PM, 0 votes:
What a pity. Even the solution I mentioned in my initial message does not always work. And its a bad luck for me and for the other developers if you ignore this bug. Hope you keep this case opened till a solution is fixed.
Contributor guide
Assessment
This issue has not been assessed yet.