Function findIDInGrid(ByVal array As ArrayList, ByVal s As String) As Integer
Dim digit As Integer = -1
For Each obj As Object In array
If obj.ToString() = s Then
digit = array.IndexOf(obj)
Exit For
End If
Next
Return digit
End Function
Protected Sub grdGoods_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdGoods.PreRender
Try
Dim array As New ArrayList
For Each row As GridViewRow In grdGoods.Rows
Dim rug_Id As Label = CType(row.FindControl("rug_Id"), Label)
If findIDInGrid(array, rug_Id.Text) <> -1 Then
grdGoods.Rows(findIDInGrid(array, rug_Id.Text)).Visible = False
End If
array.Add(rug_Id.Text)
End If
Next
end sub