求助???DataGridView能设置单元格的字体和颜色吗??
在 Winform 开发中
能设置DataGridView 单元格的字体和颜色吗??
能设置DataGridView 单元格的字体和颜色吗??
能设置DataGridView 单元格的字体和颜色吗??
------解决方案--------------------
private void datagridview1_cellformatting(object sender, datagridviewcellformattingeventargs e)
{
if (e.rowindex != -1 && e.columnindex == 1 && e.value != null && e.value.tostring() == "")
{
e.cellstyle.backcolor = color.red;
e.cellstyle.forecolor = color.blue;
e.cellstyle.selectionbackcolor = color.blueviolet;
}
}