Gop*_*ath 6 wpftoolkit wpfdatagrid
如果我们在最后一行的最后一列上按Tab键,WPF DataGrid会添加一个新行.但是在添加新行之后,焦点将移动到网格的顶行.我们如何确保焦点移动到新行的第一列?
Sam*_*Sam -1
你可以尝试类似的东西
this.SelectRowCell(this.Items.Count - 1, 0);
Run Code Online (Sandbox Code Playgroud)
但我不确定这是否也会成为焦点。如果没有,请尝试以下操作:
DataGridCell cell = this.GetCell(this.Items.Count - 1, 0);
if (cell != null)
{
cell.Focus();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1839 次 |
| 最近记录: |