Gridview has a template field with item linkbutton delete with CommandName now when user click on linkbutton then find the rowindex on Rowcommand event of gridview using C#.net
protected void grdtest1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "DeleteRow")
{
LinkButton gv = (LinkButton)e.CommandSource;
GridViewRow gvr = (GridViewRow)gv.Parent.Parent;
int rownum = gvr.RowIndex;
}
}
Wednesday, February 3, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment