I added a command argument to the link button
<itemtemplate>
<asp:linkbutton id="lnkbtnedit" runat="server" causesvalidation="False" xmlns:asp="#unknown">
CommandName="RowUpdate" ForeColor="Black" CommandArgument='<%#((GridViewRow)Container).RowIndex%>'>Edit</asp:linkbutton>
</itemtemplate>
then in the code i fetched the row index
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("RowUpdate"))
{
int index = Convert.ToInt32(e.CommandArgument);
txtnoticedate.Text = GridView1.Rows[index].Cells[2].Text;
}
}