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.
ReplyDeleteThis article provides valuable troubleshooting tips for resolving issues with accessing GridView rows—very helpful for ASP.NET developers! If you're also a gamer, Skynode is a great tool to help you manage your game library while you refine your coding skills.
ReplyDelete