日期:2014-05-18 浏览次数:21310 次
private void dgv_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
DataGridViewRow row = this.dgvPathWay.Rows[e.RowIndex];
bool isNull = false ;
if (e.ColumnIndex ==1)
{
if (row != null)
{
if (row.Cells["name1"].Value.ToString() == "")
{
isNull = true;
}
}
}
if (e.ColumnIndex ==2)
{
if (row != null)
{
if (isNull)
row.Cells["name2"].ReadOnly = true;
}
}
}