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
1725
WinGrid - Detecting if Cancel is selected by the user
posted

The grid DeleteSelectedRows method provides an option to display a prompt dialog to the user. Since the method does not return any value, is there any other way to determine if the user clicked on the "No" button.

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi Neil,

    One thing you could do is trap AfterRowsDeleted. It will only fire if the user did not cancel.So if it doesn't fire, you know the user cancelled.

    If you need more control than that, I suggest you handle the BeforeRowsDeleted event and cancel the default prompt by setting e.DisplayPromptMsg. Then you can display your own MessageBox and you will know the result. If the user cancels your dialog, you just set e.Cancel to true.

     

Reply Children