2
我有一個Windows窗體中的datagridview的工作,我給它分配的負載電網DataSource屬性。我想改變一些單元格的背景顏色(當列索引= 0時),但是當我這樣做時,我調整了窗體的大小,我遇到了問題,數據網格變得模糊不清或者單元格顯示不正確。這些照片會更好地解釋它。Datagrid中變得模糊的調整
調整大小前:
調整大小後:
這裏是我的代碼,我正在嘗試設置單元格格式...
private void dg_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
// Clients color
if (e.ColumnIndex == 0)
{
int currentClient = e.RowIndex % p.AllClients.Count;
dg.Rows[e.RowIndex].Cells[0].Style.BackColor = Color.FromArgb(p.AllClients[currentClient].Color);
}
}
提前感謝!
非常感謝您! – MirlvsMaximvs 2013-03-14 17:16:37
不客氣! – 2013-03-14 17:22:12