RadGrid NestedViewTemplate javascript runtime error

9 posts, 0 answers
  1. Sam
    Sam avatar
    3 posts
    Member since:
    Oct 2013

    Posted 01 Nov 2013 Link to this post

    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
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 06 Nov 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sam
    Sam avatar
    3 posts
    Member since:
    Oct 2013

    Posted 06 Nov 2013 Link to this post

    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



  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 08 Nov 2013 Link to this post

    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.
  6. Sam
    Sam avatar
    3 posts
    Member since:
    Oct 2013

    Posted 08 Nov 2013 Link to this post

    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
  7. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 14 Nov 2013 Link to this post

    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
  8. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 19 Nov 2013 Link to this post

    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.
  9. David Hoffman
    David Hoffman avatar
    2 posts
    Member since:
    Sep 2009

    Posted 14 Mar 2014 Link to this post

    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?
  10. David Hoffman
    David Hoffman avatar
    2 posts
    Member since:
    Sep 2009

    Posted 14 Mar 2014 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017