NunoDinis Posted June 18, 2012 at 10:31 AM Report Share #463607 Posted June 18, 2012 at 10:31 AM (edited) Bom dia, For i = 0 To MensagensDataGridView.RowCount() - 1 If MensagensDataGridView.Item(11, i).Value = "False" Then MensagensDataGridView.Item(4, i).Style.BackColor = Color.Yellow MensagensDataGridView.Item(2, i).Style.BackColor = Color.Yellow End If Next Com o código acima supostamente os valores da coluna 2 e 4 na dataGrid na posição 11 cujo valor seja "False", deveriam ficar com a cor de fundo amarela, mas não ficam. Alguma sugestão ? Edited June 18, 2012 at 10:33 AM by Caça Estranha forma de vida que tem a capacidade de transformar comandos em mensagens de erro. ndsotware.org Link to comment Share on other sites More sharing options...
ricasss Posted June 18, 2012 at 10:45 AM Report Share #463612 Posted June 18, 2012 at 10:45 AM MenagensDataGridView.Rows(i).DefaultCellStyle.BackColor = Color.Yellow Tenta assim Link to comment Share on other sites More sharing options...
NunoDinis Posted June 18, 2012 at 10:48 AM Author Report Share #463614 Posted June 18, 2012 at 10:48 AM nada feito 😕 Estranha forma de vida que tem a capacidade de transformar comandos em mensagens de erro. ndsotware.org Link to comment Share on other sites More sharing options...
jlpcalado Posted June 18, 2012 at 03:49 PM Report Share #463693 Posted June 18, 2012 at 03:49 PM Experimenta MensagensDataGridView.Rows(i).Cells(k).Style.BackColor = Color.Yellow i=indice da linha k=indice coluna Link to comment Share on other sites More sharing options...
gastao Posted June 18, 2012 at 08:48 PM Report Share #463830 Posted June 18, 2012 at 08:48 PM (edited) faz assim amigo penso que seja so adaptares If Date.Parse(DataGridView1.Rows(d).Cells("Entrada").Value.ToString) < Date.Parse(Date.Now.AddDays(-2).ToString) Then Me.DataGridView1.Rows(d).DefaultCellStyle.BackColor = Color.Goldenrod End If Edited June 19, 2012 at 09:38 PM by Caça GeSHi Link to comment Share on other sites More sharing options...
NunoDinis Posted June 19, 2012 at 10:27 AM Author Report Share #463955 Posted June 19, 2012 at 10:27 AM Não dá, mas já percebi porquê. Estou a programar com painéis, ou seja, dentro do formulário chamo 3 diferentes através dos painéis. Fiz um teste sem painéis e dá, como era de esperar.. Alguma sugestão acerca disto ? Estranha forma de vida que tem a capacidade de transformar comandos em mensagens de erro. ndsotware.org Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now