J
jack
Hi,
Consider the following handler:
protected void gridView_RowDataBound(object sender,
GridViewRowEventArgs e)
{
GridViewRow row = e.Row;
if (row.RowType != DataControlRowType.DataRow)
return;
Label lblRowNr = (Label)row.FindControl("lblRowNr");
lblRowNr.Text = String.Format("{0}.", row.RowIndex + 1);
LinkButton lnk = new LinkButton();
lnk.ID = "lnk" + row.RowIndex;
lnk.Text = "Ooops!";
lnk.Click += new EventHandler(lnk_Click); //This handler
(lnk_Click) is never get called!
row.Cells[0].Controls.Add(lnk);
}
I really don't get why the lnk_Click function is never get called.
Would you please let me know how am I supposed to do this?
Thanks
Jack
Consider the following handler:
protected void gridView_RowDataBound(object sender,
GridViewRowEventArgs e)
{
GridViewRow row = e.Row;
if (row.RowType != DataControlRowType.DataRow)
return;
Label lblRowNr = (Label)row.FindControl("lblRowNr");
lblRowNr.Text = String.Format("{0}.", row.RowIndex + 1);
LinkButton lnk = new LinkButton();
lnk.ID = "lnk" + row.RowIndex;
lnk.Text = "Ooops!";
lnk.Click += new EventHandler(lnk_Click); //This handler
(lnk_Click) is never get called!
row.Cells[0].Controls.Add(lnk);
}
I really don't get why the lnk_Click function is never get called.
Would you please let me know how am I supposed to do this?
Thanks
Jack