asp.net VB - Compare two gridviews and change cell colour based on unique / duplicate values. I'm trying to perform a basic compare between two identically formatted gridviews where column1, which contains a value, is either unique or a duplicate of column1 in gridview2. Suffice to say; I'm scratching my head. the gridviews are populated based on a sqldatasource control from a dropdownlist. That aspect works fine and for the moment I'll park trying to do that dynamically with whatever value is in the dropdownlist via autopostback. So, to help myself I'll use a button1_click as the trigger to compare whatever is currently presented in each gridview. Code: Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim arrayList1 As ArrayList = New ArrayList() Dim arrayList2 As ArrayList = New ArrayList() Dim arrayList3 As ArrayList = New ArrayList() Dim a As Integer Dim b As Integer For a = 0 To GridView1.Rows.Count - 1 Step 1 For b = 0 To GridView1.Columns.Count - 1 Step 1 arrayList1.Add(GridView1.Rows(a).Cells(b).Text) Next Next Dim c As Integer Dim d As Integer For c = 0 To GridView2.Rows.Count - 1 Step 1 For d = 0 To GridView2.Columns.Count - 1 Step 1 arrayList2.Add(GridView2.Rows(c).Cells(d).Text) Next Next If Not arrayList2.Contains(arrayList1) Then MsgBox("True") Else MsgBox("False") End If End Sub I know the above is nonsense but it's the best start-point I can find with my google fu. I'm just trying to fathom how I a) go about performing the compare and b) perform the cell colour change based on whether it matches or not. Code: Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound If e.Row.RowType = DataControlRowType.DataRow Then Dim view As DataRowView = DirectCast(e.Row.DataItem, DataRowView) Select Case Convert.ToString(view("CompareColumn")) Case "Low" e.Row.Cells(8).BackColor = System.Drawing.Color.PaleGreen Exit Select Case "Medium" e.Row.Cells(8).BackColor = System.Drawing.Color.LightYellow Exit Select Case "High" e.Row.Cells(8).BackColor = System.Drawing.Color.Pink Exit Select End Select End If End Sub I've only previously managed formatting within a sub and so I am unclear how you reference changes in cell behaviour outside of one. I know it's a shambles; any pointers would be most appreciated. TIA, Paul!