Hi @Adeel Mirza ,
e.CommandArgument only get your linkbutton's data and you don't bind it.So,you get nothing.You could do like this:
protected void gvITD_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "ViewDetails")
{
GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
int rowindex = row.RowIndex;
string Quarter = gvITD.Rows[rowindex].Cells[1].Text.ToString();
string Year= gvITD.Rows[rowindex].Cells[2].Text.ToString();
}
}
Best regards,
Yijing Sun
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.