0

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..

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by miney
0

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
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.