Gridview finding control in gridview
<p>How to find control of gridview in user defined Funtion 
...
this throws </p>

<pre><code> DataSet ds = objSelectAll.Paging(PageSize, PageNumber, USERID, ROLEID);

            if (Session["Username"].ToString() == "admin")
            { 
                foreach (GridViewRow row in UserRoleGridView.Rows)
                {
                    ImageButton ImgEditbtn = (ImageButton)row.FindControl("EditButton");
                    ImageButton ImgDelbtn = (ImageButton)row.FindControl("DeleteButton");

                    DataSet dsusr = objSelectAll.UserBasedPaging(PageSize, PageNumber, USERID, ROLEID);
                    UserRoleGridView.DataSource = dsusr.Tables[1];
                    UserRoleGridView.DataBind();
</code></pre>
