2
I want to change the color of the line DataGridView
and even with you.
Code:
private void btnativo_Click(object sender, EventArgs e)
{
MudarCor();
}
public void MudarCor()
{
dgvIngrediente.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgvIngrediente.CurrentRow.DefaultCellStyle.BackColor = Color.Yellow;
}
}
}
But when I close my form and open it again, the lines of DataGridView
return with the normal color and not with the one I changed. I would like to know how I do to save the color and leave it permanent.
you have to record this change colors in the database I see no other way!
– novic
I thought there was another way.
– enzo
permanent in my view would be database, that every time would have a color already chosen by you, opened the form read the database and ready color chosen shows... I see no other way...
– novic
If Voce already has a database for the system, it is better to use even the database, otherwise Voce can use an xml file or another text file. These would be much simpler than creating a database just to record a configuration.
– Alexandre Soares Machado
Enzo, have you tried using Attributes and giving a class to Datagridview? So the class will remain in it anyway, unless it refreshes the page.
– Renato Romão