Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
790
XamGrid Cancell adding row
posted

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.

Parents
  • 30945
    Suggested Answer
    Offline posted

    Hello,

     

    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://ko.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

    AddRowOnEnterOnly_Updated.zip
Reply Children