When deriving from DataGridBoundColumn to override control creation for your DataGrid, you are going to face a problem.. Where does my focus go when I double click the cell?
The cell control is created and activated but the focus just goes to the parent DataGridCell leaving the control that I just created in GenerateEditingElement unfocused. So I will have to click a third click to get the focus where I wanted it in the first place.
The solution is to override DataGridBoundColumn.PrepareCellForEdit and set the focus there. Voila.
My daily WPF and c# problems resolved or about to .. Every time I face worth mentioning problems that I resolved or about to resolve. I post it here so I can return to it in the future and probably others can benefit from it.
Showing posts with label WPF DataGrid DataGridBoundColumn DataGridCell GenerateEditingElement PrepareCellForEdit doubleclick focus currentcell generateelement. Show all posts
Showing posts with label WPF DataGrid DataGridBoundColumn DataGridCell GenerateEditingElement PrepareCellForEdit doubleclick focus currentcell generateelement. Show all posts
Wednesday, September 21, 2011
Subscribe to:
Posts (Atom)