Hello Infragistics Team
I'm have a XamDataGrid which currently allows user to copy paste records from excel. I need the ability to validate the grid for any errors after the clip board pasting event completes. The EditModeStarted or EditModeEnded event are not being raised after the pasting event completes. I don't understand why. Is there any other event that I can use for this purpose ? Please let me know if you require more details
Hello,
Thank you for choosing Infragistics.
I have been looking into your issue and I believe I have come up with a solution that will help you achieve the functionality you are looking for. An approach I can suggest you is to use the XamDataGrid's ExecutedCommand event. The ExecutedCommand event fires after the ClipboardPasting event and I believe that it will help you achieve the desired behavior according to the description you have provided in your post. Another event I can suggest you to take a look at is the XamDataGrid's ClipboardOperationError which fires when an error is encountered during a clipboard operation.
For more detailed information on these events please take a look at our online documentation at the following links:
http://help.infragistics.com/Help/Doc/WPF/2015.2/CLR4.0/html/InfragisticsWPF4.DataPresenter.v15.2~Infragistics.Windows.DataPresenter.DataPresenterBase~ExecutedCommand_EV.html
http://help.infragistics.com/Help/Doc/WPF/2015.2/CLR4.0/html/InfragisticsWPF4.DataPresenter.v15.2~Infragistics.Windows.DataPresenter.DataPresenterBase~ClipboardOperationError_EV.html
If you need any further assistance on this matter, please do not hesitate to ask.
Hi Tacho
I have already implemented ClipBoardOperationError event. However, this event doesn't get raised when I try to copy/paste an invalid value into a dropdown that has LimitToList property set to false. To overcome this problem, I was trying to validate the grid for errors and invoke some business logic if any error exists. Is there any grid event that gets triggered right after the ClipBoardPasting event completes ?
Regards
Shanmuga
Hello Shanmuga,
Thank you for your feedback.
I have been looking further into your issue and I have prepared a sample application for you to test and see if the desired effect is achieved.
The ExecutedCommand event fires after the ClipboardPasting event and you can use it to define your logic and validation. In the sample application I have handled the ClipboardPasting, ExecutedCommand and ClipboardOperationError event. From the sample application you can see that ExecutedCommand event fires after the ClipboardPasting event.
Would you please provide me with more detailed information on what control you are using for the dropdown and what steps you are following for pasting? Are you using a context menu for pasting in the dropdown or are you pasting a record? If the issue you have described is not reproducible in the sample I have provided or if you have used different controls and logic, would you please modify it so that the issue is reproduced and send it back to me. Having this information would help me further investigate this matter for you.