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.
|