获取列值
public bool CheckIfSame()
{
gdDetail.Update();
for (int i = 0; i < gdDetail.Rows.Count; i++)
{
for (int j = i + 1; j < gdDetail.Rows.Count; j++)
{
if (gdDetail.Rows[i].Cells["VF_Name"].Text
== gdDetail.Rows[j].Cells["VF_Name"].Text
&& gdDetail.Rows[i].Cells["VF_Name"].Text != "")
{
return true;
}
}
}
return false;
}
判重
if (CheckIfSame())
{
MessageBoxs.Show(Trans.BS, this.ToString(), "已存在,请确认后重新输入!");
return;
}