Link to home
Start Free TrialLog in
Avatar of malanois
malanois

asked on

Change Datgrid BackColor

Is there a way to change the text or the back color of a specifc row in a datagrid after it was already filled and binded.

Example

datagrid1.row(6).backcolor = red
or
datagrid1.row(5).textforecolor = blue

Any help would be great.

malanois
SOLUTION
Avatar of iboutchkine
iboutchkine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of malanois
malanois

ASKER

Alrighty Then.

Now If I can follow this it would be good.

MJ
OK, I have the class created.

I am trying to follow your code above.   I see that you are manually filling the datagrid, my grid is already filled.  

Using the above

how would i change the backcolor of row 3 in the grid.  From there i can figure out how to change the other specific rows.

Thank You,

Malanois
Check this sub
 Private Sub dg_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
...........

            If newValue <> oldValue Then
                GetEmbeddedDGTextBox(dgcc.ColumnNumber).AddRow = Me.dg.CurrentRowIndex
            End If

    End Sub


add if statement if the col# = whatever and it will work for every row but only for the specified column
I dont want the columns in every row to change.  I want row 2 (Or whatever row number I choose) and all columns in that row to change.  It is the opposite of this code.  I think

malanois
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial