[英]Get focus on a textbox inside a gridview
I have created a WPF page with a GridView
. 我用GridView
创建了一个WPF页面。 In that GridView
there are 5 TextBox
es available per row. 在该GridView
,每行有5个TextBox
。 When I enter the data on the first TextBox
in the first row and then press tab, the focus moves onto the next TextBox
. 当我在第一行中的第一个TextBox
上输入数据然后按Tab键时,焦点移动到下一个TextBox
。 I enter the data on that TextBox
and press tab and so on.... Finally I enter the data on the last TextBox
on that row and press the enter key. 我在TextBox
上输入数据并按Tab键等等....最后,我在该行的最后一个TextBox
上输入数据,然后按回车键。 The focus moves to elements outside the GridView
. 焦点移动到GridView
外部的元素。
I want the focus to move onto the first TextBox
of the second row of the GridView
. 我希望焦点移动到GridView
第二行的第一个TextBox
。
在要关注的文本框中尝试此操作..
FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}}"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.