111,093
社区成员




this.gridview1.CellFormatting += OnCellFormatting;
private void OnCellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == dataGridView1.Columns["Status"].Index)
{
int val = (int)gridview1.Rows[e.RowIndex].Cells["Status"].Value;
if(val == 0)
{
e.CellStyle.Format = "Disable";
}
else
{
e.CellStyle.Format = "Enable";
}
}