Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Referencing webcontrols in an UpdatePanel in EditItemTemplate of a Gridview

$
0
0

Hi I am getting null reference exception when trying to reference a web control which is within an AJAX UpdatePanel, which itself is within and EditItemTemplate of a Gridview. I am doing this in the RowDataBound event handler of the gridview as follows:

protected void gvIntakes_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DataRowView row = (DataRowView)e.Row.DataItem;UpdatePanel up = (UpdatePanel)e.Row.FindControl("Status_UpdatePanel"); //**** up is showing null on debug
                Panel pnlSelectStaff = (Panel) up.FindControl("pnlSelectStaff")  ;
                Panel pnlSchedule = (Panel)up.FindControl("pnlSchedule");

Any help provided will be much appreciated.

Thanks in advance!


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>