void SpecificationGroupControl_Validating(object sender, CancelEventArgs e) { if (dgConditions.Rows.Count == 0) { e.Cancel = true; errorProvider.SetError( dgConditions, "There must be at least 1 Specification or Specification Group listed"); } }