Watch this example on YouTube
REPLACE
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string test1 = e.Row.Cells[0].Text;
}
}
WITH
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lb = (Label)e.Row.Cells[0].FindControl("Label1");
string test2 = lb.Text;
}
}
Thanks so much, You saved my day.
ReplyDelete