who can help me??
I got a datagridview, one of column in datagridview is checkbox call Finish. So that, when the Finish checkbox is checkbox, I want certain row background color become yellow color.
when each time I run the program, it will display yellow color when that row Finish column was checked.
code to let row change color is
foreach(DataGridViewRow r in dataGridView1.SelectedRows)
{
r.DefaultCellStyle.BackColor = Color.Yellow;
}
Here is code to show data in datagridview(call from access database)
ConnectionStringSettings conSettings = ConfigurationManager.ConnectionStrings["MyDBConnectionString"];
string name = conSettings.ProviderName;
string providerName = conSettings.ProviderName;
string ConnectionString = conSettings.ConnectionString;
string sql = "SELECT * FROM PDC where Customer NOT LIKE 'Zhia Yi' and Customer NOT LIKE 'Trent' Order by DeliveryDate,PONO,Item";
OleDbConnection connection = new OleDbConnection(ConnectionString);
connection.Open();
sCommand = new OleDbCommand(sql, connection);
sAdapter = new OleDbDataAdapter(sCommand);
sBuilder = new OleDbCommandBuilder(sAdapter);
sDs = new DataSet();
sAdapter.Fill(sDs, "PDC");
sTable = sDs.Tables["PDC"];
connection.Close();
dataGridView1.DataSource = sDs.Tables["PDC"];
dataGridView1.ReadOnly = true;
save_btn.Enabled = false;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;