I have the below code that loops through a datagrid setting the format per the items listed in that row. For some reason I cant find how to change the button background color for just one button (some buttons will be red and some will be green). Can someone point me in the correct location?
dataGridTicketSearch.Rows[dgvr.Index].DefaultCellStyle.Font = new Font("Arial", 12);
dataGridTicketSearch.Rows[dgvr.Index].DefaultCellStyle.ForeColor = Color.Black;
dataGridTicketSearch.Rows[dgvr.Index].Cells["colAction"].Value = "Redeem";
dataGridTicketSearch.Rows[dgvr.Index].Cells["colAction"].Style.BackColor = Color.Green;

1 answers
If I remember correctly, you can only change the background color of the button if you change the FlatStyle property of the button column from Standard (the default) to either Flat or Popup:
The code you had should then work.
answered one year ago by:
17279