Jump to content

Recommended Posts

Posted (edited)

Boas, eu criei um evento (CellContentClick) no datagridview para quando uma coluna for igual a 0 aparecer essa linha a vermelho

e para isso utilizei o seguinte codigo:


private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.Value != null && e.ColumnIndex == 12 && e.Value.Equals("0"))
{
DataGridViewColumn row = dataGridView1.Columns[e.ColumnIndex];
row.DefaultCellStyle.ForeColor = Color.Red;
}
}

mas está-me a dar um erro no Valuw

O que diz no erro é: 'System.Windows.Forms.DataGridViewCellEventArgs' does not contain a definition for 'Valu' and no extension method 'Value' accepting a first argument of type 'System.Windows.Forms.DataGridViewCellEventArgs' could be found (are you missing a using directive or an assembly reference?)

sinceramente não percebo porque isto não esta a dar, alguem me pode ajudar? se faz favor....

Desde ja, Obrigada

Edited by Caça
GeSHi
Posted

nao existe a Propriedade Value no DataGridViewCellEventArgs

Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender.

A beleza de um código está em decompor problemas complexos em pequenos blocos simples.

"learn how to do it manually first, then use the wizzy tool to save time."

"Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast."

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.