Protected Sub GridView1_RowCreated()Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
If (e.Row.RowType = DataControlRowType.DataRow) Then
Dim bt1 As Button = CType(e.Row.FindControl("cart"), Button)
bt1.CommandArgument = e.Row.RowIndex.ToString
Dim bt2 As Button = CType(e.Row.FindControl("favorite"), Button)
bt2.CommandArgument = e.Row.RowIndex.ToString
End If
End Sub
If (e.Row.RowType = DataControlRowType.DataRow) Then
Dim bt1 As Button = CType(e.Row.FindControl("cart"), Button)
bt1.CommandArgument = e.Row.RowIndex.ToString
Dim bt2 As Button = CType(e.Row.FindControl("favorite"), Button)
bt2.CommandArgument = e.Row.RowIndex.ToString
End If
End Sub