Hello Every one ,

I try to make program .. which have to Gridview
one contains all Data in the Databasae and another is contains some of these data
and I try to compare between this Two GridView and show that gridview1 is contains the data in gridview2 by change the color of row in the gridview1...
(My idea is to make program that contain Course Table and anothe Table called Coursetaken... I fill the Gridview with the first table and I want to make the subject that user take in another color so its easy to know which subject is take or not depend of the row color )
I am binding the data By SqlDataSource


please help me..

Can anuone Help me and tell me where is the error in this code
because the row is not changed

Protected Sub grid_RowDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) _
Handles grid.RowDataBound

If e.Row.RowType = DataControlRowType.DataRow Then
' Get the price for this row.
Dim name As String
name= CType(DataBinder.Eval(e.Row.DataItem, "Name"), String)
If name="Miney" Then
e.Row.BackColor = System.Drawing.Color.Maroon
e.Row.ForeColor = System.Drawing.Color.White
e.Row.Font.Bold = True
End If
End If

also I try it like this

If name.equals("Miney") Then
e.Row.BackColor = System.Drawing.Color.Maroon
e.Row.ForeColor = System.Drawing.Color.White
e.Row.Font.Bold = True
End If

End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.