This is a migrated thread and some comments may be shown as answers.

RadGrid NestedViewTemplate javascript runtime error

8 Answers 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 02 Nov 2013, 01:14 AM
Hello,

I created a simple RadGrid with a NestedViewTemplate and a SqlDataSource1, no code behind involve.  When I click
 expand link and show the static text inside the NestedViewTemplate, I get javascript runtime error:

Unhandled exception at line 6, column 74203 in http://localhost:49573/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:d618f02c-bda7-40f1-bb64-308e08f719c3:ea597d4b:b25378d2;Telerik.Web.UI:en-US:ac331549-681c-4402-9fb7-09ec3c579ee8:16e4e7cd:f7645509:22a6274a:ed16cbdc:58366029:24ee1bba:f46195d3:2003d0b8:88144a7a:1e771326:aa288e2d

0x800a138f - JavaScript runtime error: Unable to set property 'control' of undefined or null reference


<
telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AllowPaging="true">
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1">
                <Columns>
                    <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" FilterControlAltText="Filter ProductID column" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Name" SortExpression="Name" UniqueName="Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ProductNumber" FilterControlAltText="Filter ProductNumber column" HeaderText="ProductNumber" SortExpression="ProductNumber" UniqueName="ProductNumber">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Size" FilterControlAltText="Filter Size column" HeaderText="Size" SortExpression="Size" UniqueName="Size">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Color" FilterControlAltText="Filter Color column" HeaderText="Color" SortExpression="Color" UniqueName="Color">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="MakeFlag" DataType="System.Boolean" FilterControlAltText="Filter MakeFlag column" HeaderText="MakeFlag" SortExpression="MakeFlag" UniqueName="MakeFlag">
                    </telerik:GridCheckBoxColumn>
                </Columns>
                <NestedViewTemplate>
                    dssfaddfssd
                </NestedViewTemplate>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorks2008R2ConnectionString %>" SelectCommand="SELECT [ProductID], [Name], [ProductNumber], [Size], [Color], [MakeFlag] FROM [Production].[Product]"></asp:SqlDataSource>

If above code added to a RadControlWebApp project, it is running fine.  But if it added to a existing ASP.NET
 Web Forms Application. Also, I made sure that Telerik.Web.UI and Skins are added to references and web.config

What am I missing here to make NestedViewTemplate to work? It stopped working in Q3 2013 after upgraded.

Thanks in advance
Sam

8 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 06 Nov 2013, 04:40 PM
Hello Sam,

I tried replicating the described issue but to no avail. There is a Web Forms Application project attached which I created using the RadGrid settings from your description. It seems to be working as expected on my side. Give it a try and see if it is working for you.

Could you tell me what modifications I need to make to the project in order to replicate the problem? I am looking forward to your reply.

Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Sam
Top achievements
Rank 1
answered on 07 Nov 2013, 12:49 AM
Thank you Viktor your support.
When I click on row expand of the grid, the RadGrid layout breaks on postback (no javascript runtime error this time).  Here what I did before run your sample project:

  1. I do not have Northwind database, so I have to use AdventureWorks instead
  2. I have to import references files: Telerik.Web.Design, Telerik.Web.UI, and Telerik.Web.UI.Skin (error when compile)

Here is the code (no code behind):

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
           <Scripts>
               <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
               <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
               <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
           </Scripts>
       </telerik:RadScriptManager>
       <script type="text/javascript">
           //Put your JavaScript code here.
       </script>
       <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
       </telerik:RadAjaxManager>
       <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AllowPaging="true">
           <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1">
               <Columns>
                   <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" FilterControlAltText="Filter ProductID column" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn DataField="ProductName" FilterControlAltText="Filter Name column" HeaderText="Name" SortExpression="Name" UniqueName="Name">
                   </telerik:GridBoundColumn>
                   <telerik:GridCheckBoxColumn DataField="Discontinued" DataType="System.Boolean" FilterControlAltText="Filter MakeFlag column" HeaderText="MakeFlag" SortExpression="MakeFlag" UniqueName="MakeFlag">
                   </telerik:GridCheckBoxColumn>
               </Columns>
               <NestedViewTemplate>
                   dssfaddfssd
               </NestedViewTemplate>
           </MasterTableView>
       </telerik:RadGrid>
       <asp:SqlDataSource ID="SqlDataSource1" runat="server"
           ConnectionString="<%$ ConnectionStrings:AdventureWorks2008R2ConnectionString %>"
           SelectCommand="SELECT [ProductID], [Name], [ProductNumber], [Size], [Color], [MakeFlag] FROM [Production].[Product]"></asp:SqlDataSource>

I have included screenshots of before and after RadGrid render.

Thank you,
Sam



0
Viktor Tachev
Telerik team
answered on 08 Nov 2013, 12:44 PM
Hello Sam,

There is an issue with RadControls version 2013.3.1015 in Visual Studio 2013. It has already been fixed and will be officially introduced in the SP1 release of RadControls. The service pack is due to be released within the upcoming weeks.

Until then you could download the latest internal release available in our site. Also if you have Visual Studio 2012 this issue should not be present.

I hope this would be helpful.

Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Sam
Top achievements
Rank 1
answered on 08 Nov 2013, 11:23 PM
Viktor, you're right! I tested the same application on Visual Studio 2012 works fine.

Again, thank you for your support.

Have a great weekend,
Sam
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 14 Nov 2013, 01:56 PM
Hi,
Run into exactly the same problem under VS 2013.
Any Idea when the SP will be available? If possible I would like to avoid the interim build as it is not in microsoft installer format.

Regards
Erwin
0
Viktor Tachev
Telerik team
answered on 19 Nov 2013, 01:03 PM
Hi,

I would like to inform you that the Service Pack was released on 14th of November. You should be able to download it from our site after logging in.

Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
David Hoffman
Top achievements
Rank 1
answered on 14 Mar 2014, 07:58 PM
I have just upgraded a Visual Studio project from VS 2012 to VS 2013. I also upgraded to Telerik UI Q1 2014. However, I am getting a JavaScript Runtime Error with every RadGrid that has nested RadGrids. The error occurs when opening the nested RadGrid. Ignoring the error seems to allow the program to continue and operate correctly.

Do you have additional advice or corrections to what appears to be a VS 2013 issue?
0
David Hoffman
Top achievements
Rank 1
answered on 14 Mar 2014, 08:23 PM
After additional research, I found the post cited below. This is a jQuery issue in VS2013 which does not yet have a fix. I disabled my Browser Link feature and the errors stopped.

http://www.telerik.com/forums/the-new-browser-link-feature-in-vs-2013-is-causing-an-error-when-detailtable-of-hierarchy-radgrid-is-expanded
Tags
Grid
Asked by
Sam
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Sam
Top achievements
Rank 1
erwin
Top achievements
Rank 1
Veteran
Iron
David Hoffman
Top achievements
Rank 1
Share this question
or