G
Guest
hey all,
i'm inside a RowDataBound event and i'd like to dynamically add a button to
an empty gridView column with a click event handler. i'm having trouble with
wiring my procedure to the btn click event.
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button btn = new Button();
btn.Click += ??? (trying to get the method below to run)
e.Row.Cells[2].Controls.Add(btn);
}
}
protected void BtnClickEventHandler(object sender, EventArgs e)
{
Response.Write("It Worked.");
}
any ideas?
thanks,
rodchar
i'm inside a RowDataBound event and i'd like to dynamically add a button to
an empty gridView column with a click event handler. i'm having trouble with
wiring my procedure to the btn click event.
protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button btn = new Button();
btn.Click += ??? (trying to get the method below to run)
e.Row.Cells[2].Controls.Add(btn);
}
}
protected void BtnClickEventHandler(object sender, EventArgs e)
{
Response.Write("It Worked.");
}
any ideas?
thanks,
rodchar