Hello,
I have a xamGrid with a dynamic columns. In my Xaml i don't know what column i will have in my ItemsSource. It might contain ComboBox column and DateTime column (with DatePicker).
I want the functionality that only on Enter click the new row will be added or Edit finished. And on escape - adding/editing will be cancelled. Clicking outside the XamGrid Won't do nothing.
How can i do it?
I search in your forums- i found something similar- but there the XamGrid columns are not dynamic as in my case.
Thank you for your post. I have been looking into the functionality that you wish to implement and I have modify the sample application from the following post: http://es.infragistics.com/community/forums/p/71150/360473.aspx#360473 in order to achieve you goal. To do that I have set the AutoGenerateColumns property to true and handled the PreviewKeyDown event of the e.Cell.Control in the CellControlAttached event and if the enter key is pressed, I am calling the ExitEditMode method of the XamGrd. I am using the preview event, since the KeyDown event is internally handled for the ComboBox and the DatePicker, which prevents the bubbling of the event to the CellControl.
If you need any further assistance please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thanks.
one of my columns can be Date with DatePicker.
two things:
1. DatePicker is not opened on edit row (it is opened on AddNewRow)
2. I need same functionally (enter for adding/edit row, escape for cancel add/edit).
Also i want a functionality- when XamGrid loses focus (user clicked on another control), than editing/adding will be cancelled as well. How can i do it? I tried with XamGrid lost focus event, but it is being fired also when clicking in a cell in the XamGrid, and than add/editing is cancelled as well.