I added a linkbutton in a TemplatedField in a WebGrid.When I Click the LinkButton,How To Get the Row index in LinkButton Click event??
protected void btnLink_Click(object sender, EventArgs e) { int rowIndex = ((CellItem)((Control)sender).NamingContainer).Cell.Row.Index; }