XmlDataSource FindControl within FormView and TabContainer

I have a Gridview displaying data from a xml datasource that I am populating in codebehind which displays the data if placed in a plain web page but I need to add the data within a FormView and TabContainer. When I add the gridview inside the Formview nothing is displayed.

I have other Datalist and Gridviews within the formview and inside tabcontainers which all display ok using the following findcontrol

            DataList CostOnSiteDataList = (DataList)PropertyForm.FindControl("propertycontainer").FindControl("Panel2").FindControl("COSDataList");

This is the Gridview;

                                                         <asp:GridView ID="COSGridView" DataSourceID="XmlDataSourceCOS" GridLines="None" runat="server" Width="100%" AutoGenerateColumns="false" BackColor="#FFFFFF" ShowHeader="False">
                                                                        <table width="100%">
                                                                        <tr valign="top">
                                                                        <td align="left">
                                                                        <asp:Label ID="Costs_Description_Label" runat="server" CssClass="pdheading" Text='<%# XPath("Description") %>' /><br />
                                                                        <td align="right">
                                                                        <asp:Label ID="Costs_Value_Label" runat="server" CssClass="pdheading" Text='<%# XPath("Value") %>' />
    <asp:XmlDataSource ID="XmlDataSourceCOS" EnableCaching="false" runat="server" XPath="//COS" />

and the code behind data tag which loadsa the data when the gridview is outside of the formview.

             XmlDataSourceCOS.Data = root9.OuterXml;


                                <asp:FormView ID="PropertyForm" runat="server" Width="100%" CellSpacing="3">
    <cc1:tabcontainer runat="server" id="propertycontainer" width="955px" cssclass="mytabs" onclientactivetabchanged="ActiveTabChanged">
        <cc1:TabPanel runat="Server" ID="Panel1" HeaderText="Information">
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
If you move a control inside of another naming container, then it would change the behavior for FindControl, which might be the reason for your problems...
chrispatonAuthor Commented:
In the end I had to remove the formview and change the page design as this was the only way I could get this to work properly

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chrispatonAuthor Commented:
The suggestion made did not work as the item was still not displaying data on the page
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.