how can i change row color in datagrid?

berzegerol

New member
Joined
Oct 28, 2006
Messages
1
Programming Experience
Beginner
hi
i am using sqlserver and datagrid.
i want to change to the rows color while aplication runnig
and i specially want to change the color of row that in the index that i specified with writing code
for example
DataGrid1.CurrentRowIndex = 3
i want to change this row.

how can i do this

thanks..
 
How about this:
VB.NET:
Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles DataGrid1.CurrentCellChanged
    Dim dg As DataGrid = DirectCast(sender, DataGrid)
    dg.Select(dg.CurrentRowIndex)
    dg.SelectionBackColor = Color.Blue
End Sub
 
Back
Top