WPF DataGrid Get Cell Value while user is typing
I have a WPF DataGrid and i want to show a completion list below the cell curr开发者_StackOverflow中文版ently being edited. I cannot seem to find a way to get the uncommitted value. I tryed catching all key down events but cannot find where the value is stored until it is committed.
How about using the AutoCompleteBox from the WPF Toolkit in a DataGridTemplateColumn? (Sounds like it addresses your problem).
Use the PreviewKeyDown event to get the actual value of the key that was pressed. You can then extract the DataRowView and the CurrentCell.Column.DisplayIndex from the sending object, that will give you the current cell contents without the new key that was pressed.
精彩评论