Wednesday, November 11, 2009

GridView's RowCommand !!

Protected void GVMyProdct_RowCommand (object sender, GridViewCommandEventArgs e )
{

GridViewRow Row = (GridViewRow)(Button)e.CommandSource).NamingContainer;
Label lblPrice=(Label)row.FindControl("lblPrice");
if (e.CommandName=="AddCart")
{

}
}

# Command Name is the property of which is inside the

Inside the 's has the properties :

Text = "Add to cart";
Command Name = "AddCart";
Command Argument = '<%#DataBinder.Eval(Containe.DataItem,"Product_id")%>'

No comments: