I build a gridview at runtime that works great. Now, I have to add a linkbutton to the gridview at runtime (the linkbutton will allow display a modal popup for editing). The code below is not working. I use similar code to add an imagecontrol to the gridview and it works. Can anyone help?
// Add the edit linkTemplateField tfEdit = new TemplateField();tfEdit.ShowHeader = false;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!