I am using Microsoft WPF datagrid. I have noticed a strange behavior with WPF datagrid DataGridTemplateColumn. When you use the templateColumn in the grid and the template column contains some controls when you tab from the previous column the focus is not automatically given to the first element declared in the template column. The foucs is initally set on the border of the template column and when we tab of once agin the focus goes to the first column. Any workaround for this issue. How can i set the focus to go the first element in the template column of the datagrid when i tab off.
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
There is a solution using a static class and one change to the Xaml for the control you want focused. "WPF DataGrid: Tabbing from cell to cell does not set focus on control"
I got rid of this problem by handling PrepareCellForEdit event of the grid. Here is the code
I found out a link in WPF datagrid codeplex discussions http://www.codeplex.com/wpf/Thread/View.aspx?ThreadId=35540
Thanks to vincent sibal
We solved this problem by modifying the style on DataGridCell: