title: Prompting message to user to Save the current row on DavaGridView_RowLeave
body: <p>I have two DataGridViews with editable by the user.
  When the user select a row in DataGridViewA then DatagridViewB is populated with different data accordingly.</p>
  
  <p>Once edited the current row in DataGridViewA, the user can click on the save button. In case he didn't save and select another row in DataGridViewA, a message for save will be prompted to the user asking him if he want to save before moving to another row. (I have a method that check if there are changes and if yes, prompt a message to the user if he wants to save - yes: Save, No: Restore Data).</p>
  
  <p>The method that checks if there are changes is triggered on DataGridViewA_Leave(). The reason is that I have the information of the DataGridViewA.CurrentRow before leaving the row so I can Save if needed.</p>
  
  <p>The problem is if I am clicking on any other control on my form such as Save button the Save message to the user prompt (because the DataGridViewA.CurrentRow is left). In this case, I do not want the user to get a message.</p>
  
  <p>I found a workaround to fix it but it is not the best way to do it I presume. Before prompting the message, I am checking if the Save button has focus. This check need to be done for all the controls that I don't want to get a Save message when clicking on them.</p>
  
  <p>Is there any better solution to solve this issue?</p>
  
  <p>My code, the record state is Added (user add a row) or Edited (user update some data) :</p>
  
  <pre><code>private void AlternateDGV_RowLeave(object sender, DataGridViewCellEventArgs e)
      {            
          if (IsSaveNeeded)
          {
              if (SaveButton.Focused) // This is the work around
              {
                  return;
              }
  
              if (!WasSavedPerUserRequest())
              {
                  var recordstate = AlternateDGV.CurrentRow.Cells[Glossary.RecordStateName].Value.ToString();
                  if (recordstate == Glossary.AddedRecordState)   // if it was a new row added and the user doesn't want to save
                  {                        
                      AlternateDGV.CurrentRow.Delete();
                  }
                  else if (recordstate == Glossary.EditedRecordState) // if it was a row from DB and the user doesn't want to save, refresh with saved data
                  {
                      AlternateDGV.CurrentRow.Refresh(_items);
                  }
              }
          }
      }
  </code></pre>