We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : WinForms
Category : Datagrid

How can I catch when the user clicks off the grid, say to close the form

You can catch clicking off a DataGrid in the DataGrid.Validated event. But this event is also hit when you use the Tab key to move around the grid. So, if you want to catch it exclusively for clicking off the grid, you have to ignore the event due to the tab. One way to do this is to derive DataGrid and override ProcessDialogKey, noting whether the key is a tab before processing it. Then in your Validated event handler, you can check for this tab. Here are some snippets.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon