If you are trying to get the reference of the LinkButton for a particular row, you need to use FindControl method without for loop but inside the RowDataBound event as shown below:
protected void gvRatings_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label Points = ((Label)e.Row.FindControl("LabelPoints"));
//do what ever you want to do here using the value of your label
}
}
You need to concatenate the values in an array to store text for all the values:
str[] arrValues = new arrValues[20];
for (int i = 0; i < grdApproval.Rows.Count; i++)
{
LinkButton lblAssId = (LinkButton)grdApproval.Rows[i].FindControl("lnkAssId");
arrValues[i]=lblAssId.Text;
Session["AssId"] = arrValues[i];
}
Thanks