问题描述
我有一个数据网格,该数据网格绑定到TwoWay路径中的列表.
我发现的网格的Enter键的默认行为是向下移动.
我使用以下代码使运动向右移动
I have a datagrid which is bound to a list in TwoWay path.
the default behavior of the enter key for the grid which i found is move down.
i used the following code to make the movement to the right
var element = e.OriginalSource as FrameworkElement;
if (e.Key == Key.Enter)
{
e.Handled = true;
element.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
}
但是现在我的网格的问题是它没有为新项目添加空行.它没有做任何新的项目占位符.
1)有没有一种方法可以在wpf或
中的DataGrid中手动添加新的空行2)我可以使用任何方法使网格能够添加新行或移动到最后一个可聚焦列之后的下一个新行吗?
But now the issue to my grid is that it does not add an empty row to for the new item. It is not making any new item place holder.
1) Is there a way to add manually a new empty row in DataGrid in wpf or
2) can i use any method to make my grid to be able to add a new row or move to the next new row after the last focusable column?
thank you in advance.
推荐答案
这篇关于如何在WPF中的DataGrid中添加空行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!