C# datagridview 格式化单元格内容

2021-02-04 09:14

阅读:433

标签:return   oid   column   weight   orm   nta   turn   ssm   ret   

private void dgvBig_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
 
if (dgvBig.Columns["IsBigWeight"].Index == e.ColumnIndex)
{
if (e.Value == null)
{
return;
}
if (e.Value.Equals("0"))
{
e.Value = "否";
}
else
{
e.Value = "是";
}
}
if (dgvBig.Columns["IsSmallWeight"].Index == e.ColumnIndex)
{
if (e.Value == null)
{
return;
}
if (e.Value.Equals("0"))
{
e.Value = "否";
}
else
{
e.Value = "是";
}
}
if (dgvBig.Columns["IsComplete"].Index == e.ColumnIndex)
{
if (e.Value == null)
{
return;
}
if (e.Value.Equals("0"))
{
e.Value = "否";
}
else
{
e.Value = "是";
}
}
}

C# datagridview 格式化单元格内容

标签:return   oid   column   weight   orm   nta   turn   ssm   ret   

原文地址:https://www.cnblogs.com/lzsin/p/11477360.html


评论


亲,登录后才可以留言!