c#winform datagridview隐藏单元格的值
c#winform datagridview隐藏单元格的值
//隐藏单元格的值 private void dataGridView_front_section_storage_07_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { if (e.ColumnIndex != dataGridView_front_section_storage_07.Columns["c1"].Index) //"c1" column1的title { //string description = "something"; if (e.Value != null) { // if (e.Value.ToString() == description) if (e.Value.ObjToInt() >=1) { e.CellStyle.ForeColor = e.CellStyle.BackColor; e.CellStyle.SelectionForeColor = e.CellStyle.SelectionBackColor; } } } }
欢迎讨论,相互学习。
cdtxw@foxmail.com