private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)  
  {  
  double d= 0.0;  
  dataGridView1.Rows[e.RowIndex].ErrorText = string.Empty;  
  if(dataGridView1.Columns[e.ColumnIndex].DataPropertyName == "A")  
  {  
  if(!double.TryParse(e.FormattedValue.ToString(),out d) || d>0.0)  
  {  
  dataGridView1.Rows[e.RowIndex].ErrorText = "输入有误!";  
  e.Cancel = true;  
  }  
  }  
  }