you can do this programmatically in the rowcreated event of the gridview.
Add a buttonfieldcolumn to the gridview
<asp:buttonfield buttontype="Button"
commandname="Select"
headertext=""
text="Select"/>
Once user clicks on the select button, you can redirect him to the page you want
public void ProductsView_RowCommand(Object sender, GridViewCommandEventArgs e)
{
// If multiple ButtonField column fields are used, use the
// CommandName property to determine which button was clicked.
if (e.CommandName == "Select")
{
// Convert the row index stored in the CommandArgument
// property to an Integer.
int index = Convert.ToInt32(e.CommandArgument);
// Get the product id of the selected product
GridViewRow selectedRow = gvProducts.Rows[index];
string ID = gvProducts.DataKeys[index].Value.ToString();
//Redirect the user to product detail view page
Server.Transfer("ProductDetailView.aspx?ProductID=" + ID);
}
}
You will find the complete example at
http://technico.qnownow.com/2012/03/28/using-gridview-in-asp-net-c-part-2/ karunakar5788-15015, if this helps please login to Mark As Answer. | Alert Moderator