Ok - the button should be a gridview template:
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="Button" runat="server"
CommandName="Button"
CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"
Text="Add to Cart" />
</ItemTemplate>
</asp:TemplateField>
That way you have full control in code behind:
protected void GridView1_RowCommand(object sender,
GridViewCommandEventArgs e)
{
if (e.CommandName == "Button")
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = GridView1.Rows[index];
}
}
Hope that helps ^_^
Andy