Click here to Skip to main content
15,881,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have created few dynamic grid view inside a panel

Method where i added control


i'm saving the grid view id in a hidden variable

i added a button inside a update panel

string[] GridName = hdnGridName.Value.Split(',');
      foreach (string GN in GridName)
          GV = this.FindControl("pRelaese").FindControl(GN) as GridView;//tried this
          pnl = (Panel)Page.FindControl("pRelaese");//tried this
          GV = (GridView)pnl.FindControl(GN);//tried this
          if (GV != null)
              foreach (GridViewRow GVR in GV.Rows)

But every time the
is returned to GV

i need to find control and insert it into GV to perform of the task
Updated 1-Nov-15 19:47pm
Sinisa Hajnal 2-Nov-15 6:25am    
When you load the page, press F12 to bring up developer tools and check grid IDs in page source. Depending on how you create them and what IDs you're using in hidden control you might get null because they don't match. (server controls get their names mangled in
write2varun 2-Nov-15 6:43am    
the hidden control has the same id as the id getting rendered

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900