I tried to recreate this demo: http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx
I copied the code given at the bottom of the page and made a few changes. I also changed the panel visibility to true since the panel and the items in it (the grid, tabs, panel background image) will not be displayed if the visibility is set to false. I don't know why you set the panel's visibility to false in the code given. Care to enlighten me on this?
However that's not the reason why I create this thread. When I tried to debug, I get this error message:
Exception Details: System.InvalidOperationException: Could not find control 'Label1' in ControlParameter 'ParentID'.
I'm this close to tearing my hair out trying to debug this. Can you tell me what went wrong?
Here's my code:
I copied the code given at the bottom of the page and made a few changes. I also changed the panel visibility to true since the panel and the items in it (the grid, tabs, panel background image) will not be displayed if the visibility is set to false. I don't know why you set the panel's visibility to false in the code given. Care to enlighten me on this?
However that's not the reason why I create this thread. When I tried to debug, I get this error message:
Could not find control 'Label1' in ControlParameter 'ParentID'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: Could not find control 'Label1' in ControlParameter 'ParentID'.
I'm this close to tearing my hair out trying to debug this. Can you tell me what went wrong?
Here's my code:
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MiniApp5b._Default" %><%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %><asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"></asp:Content><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <h2> Welcome to ASP.NET! </h2><asp:SqlDataSource ID="edata3" runat="server" ConnectionString="<%$ ConnectionStrings:GreenDataConnectionString %>" SelectCommand="SELECT * FROM [Category5Parent]"></asp:SqlDataSource><asp:SqlDataSource ID="edata5" runat="server" ConnectionString="<%$ ConnectionStrings:GreenDataConnectionString %>" SelectCommand=" SELECT * FROM Category5Child INNER JOIN Category5Parent ON Category5Child.ParentID = Category5Parent.ParentID WHERE ParentID = @ParentID "> <SelectParameters> <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="Int32" Name="ParentID" /> </SelectParameters></asp:SqlDataSource> <telerik:RadGrid ID="RadGrid4" runat="server" CellSpacing="0" DataSourceID="edata3" GridLines="None"> <MasterTableView AutoGenerateColumns="False" DataKeyNames="ParentID" DataSourceID="edata3"> <NestedViewTemplate> <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap1" Visible="true"> <telerik:RadTabStrip runat="server" ID="TabStrip1" MultiPageID="Multipage1" SelectedIndex="0"> <Tabs> <telerik:RadTab runat="server" Text="Sales" PageViewID="PageView1"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Contact Information" PageViewID="PageView2"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Statistics Chart" PageViewID="PageView3"> </telerik:RadTab> </Tabs> </telerik:RadTabStrip> <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false"> <telerik:RadPageView runat="server" ID="PageView1"> <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("ParentID") %>' Visible="false" runat="server" /> <telerik:RadGrid runat="server" ID="GridIntab" DataSourceID="edata5" ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false"> <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" DataKeyNames="ChildID" PageSize="7" HierarchyLoadMode="ServerOnDemand"> <Columns> <telerik:GridBoundColumn DataField="ChildID" DataType="System.Int32" FilterControlAltText="Filter ChildID column" HeaderText="ChildID" ReadOnly="True" SortExpression="ChildID" UniqueName="ChildID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ChildName" FilterControlAltText="Filter ChildName column" HeaderText="ChildName" SortExpression="ChildName" UniqueName="ChildName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ParentID" DataType="System.Int32" FilterControlAltText="Filter ParentID column" HeaderText="ParentID" SortExpression="ParentID" UniqueName="ParentID"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageView2" Width="460px"> <%-- TO DO --%> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageView3"> <%-- TO DO --%> </telerik:RadPageView> </telerik:RadMultiPage> </asp:Panel> </NestedViewTemplate> <CommandItemSettings ExportToPdfText="Export to PDF"> </CommandItemSettings> <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"> </RowIndicatorColumn> <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="ParentID" DataType="System.Int32" FilterControlAltText="Filter ParentID column" HeaderText="ParentID" ReadOnly="True" SortExpression="ParentID" UniqueName="ParentID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ParentName" FilterControlAltText="Filter ParentName column" HeaderText="ParentName" SortExpression="ParentName" UniqueName="ParentName"> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView><FilterMenu EnableImageSprites="False"></FilterMenu></telerik:RadGrid></asp:Content>