You cann't access controls which are inside Gridview as like normal. You have do find those controls and then try to access those.
See example below.
protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Panel panel_find = ((Panel)e.Row.FindControl("pnlOrders"));
panel_find.Visible=true;
}
}
Note: You can access all controls which are inside Gridview by finding those as mentioned below.
Hope this works and also helps you..