DataGridView changing cell background color

后端 未结 10 1684
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 10:20

I have the following code :

private void dgvStatus_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
{
    foreach (DataGridViewRow          


        
10条回答
  •  情话喂你
    2020-11-30 10:32

    You can use the VisibleChanged event handler.

    private void DataGridView1_VisibleChanged(object sender, System.EventArgs e)
    {
        var grid = sender as DataGridView;
        grid.Rows[0].Cells[0].Style.BackColor = Color.Yellow;
    }
    

提交回复
热议问题