private bool IsCellDirty(DataGridViewCell cell)
{
bool isDirty = false;
if (cell != null)
{
var oldText = cell.Tag as string;
if (cell.EditedFormattedValue != null)
{
string newText = cell.EditedFormattedValue.ToString();
isDirty = !newText.Equals(oldText);
}
}
return isDirty;
}