I create a gridview at runtime and would like to add a linkbutton to each row of the gridview also at runtime but, I can't figure out how to do this. The code that doesn't work is below. The linkbutton will be used to launch a modal popup window that will allow the user to edit the selected gridview row in a formview type manner.
LinkButton lb = new LinkButton();
lb.ID = "lnkEditProduct";
lb.Text = "Edit Item";
lb.CommandArgument = "<%# Bind('itemID') %>";
lb.CommandName = "EditProduct";
lb.CausesValidation = false;
gvResults.Columns.Add(lb);
Thank you!
LinkButton lb = new LinkButton();
lb.ID = "lnkEditProduct";
lb.Text = "Edit Item";
lb.CommandArgument = "<%# Bind('itemID') %>";
lb.CommandName = "EditProduct";
lb.CausesValidation = false;
gvResults.Columns.Add(lb);
Thank you!