我試圖用此代碼在DataGridView
中更改Background
行。'System.Windows.Forms.DataGridViewRow'不包含'BackColor'的定義
DataGridViewRow row = (DataGridViewRow)dataGridView1.Rows[RowNumber].Clone();
row.Cells[1].Value = "Hey World";
row.BackColor = System.Drawing.Color.Gray;
但在第三行是此錯誤:
'System.Windows.Forms.DataGridViewRow' does not contain a definition for 'BackColor' and no extension method 'BackColor' accepting a first argument of type 'System.Windows.Forms.DataGridViewRow' could be found (are you missing a using directive or an assembly reference?)