DataGridView单元格格式化

 private void dgvLabList_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            if (dgvLabList.Columns[e.ColumnIndex].Name == "IsBegin"  && e.Value is Boolean && e.Value != null)
            {
                if (Convert.ToString(e.Value) == "True")
                {
                    e.Value = "";
                }
                else if (Convert.ToString(e.Value) == "False")
                {
                    e.Value = "";
                }
            }
        }

 

你可能感兴趣的:(DataGridView单元格格式化)