I have a Grid element with a XamDataGrid and a Popup.
I open the popup on enter edit mode and close it on end edit mode. The problem is when I click on any other element (outside of the grid), the popup stays open because the cell doesn't exit edit mode.
I have cellclickaction set to selectcell so that double-click starts edit mode.
Let me know if you need more information.
Thank you for your post!
I have been looking into it and it seems that I am missing something from your scenario. From the thread it seems that you are using some custom implementation for editing of the XamDataGrid.
Would you please provide me with some additional information about the functionality you are using? If possible would you please provide me with a small sample application, showing the functionality you are using? If not, would you please provide me with more detailed information about the XAML and code behind code, that you are using?
Thank you for the provided information. Looking forward to hearing from you.
Here is a link to a sample application.
It looks like the issue is in combination with the XamRibbonWindow.
1. Double-click one of the age cells.
2. Click the button below the XamDataGrid and you will notice the Popup disappears properly.
3. Double-click one of the age cells again.
4. Click the New Window button in the XamRibbon.
You will see that the Popup stays visible and behaves differently than when you click a normal button.
Thank you for the provided sample application.
I have been looking into it. The behavior you are seeing is expected, because the XamRibbon control does not take focus. The EditoModeEnded event of the XamDataGrid does not get fire, when the user presses the button in the XamRibbon, since the XamDataGrid is still on focus.
In order to get the EditoModeEnded event to fire you can execute the EndEditModeAndCommitRecord command of the DataPresenterCommands in the Click event handler of the button.
One more thing I can suggest is to set the IsOpen property of the Popup to false in the Click event handler of the button.
I have implemented the above mentioned functionalities in the sample application you have provided. Please find the modified sample application and feel free to let me know if you have any further questions on this matter.