Error when showing window

3 posts, 0 answers
  1. Andy
    Andy avatar
    27 posts
    Member since:
    Nov 2010

    Posted 13 Dec 2013 Link to this post

    I get the following javascript error when I try to show a RadWindow

    JavaScript runtime error: Unable to get property 'parentNode' of undefined or null reference

    The error is in the following code (3rd line)

    },_isWindowRightToLeft:function(){var d=this._isRightToLeft;

    if(d==null){var c=this.get_element();

    var e=c.parentNode?c:this._getDefaultParent();

    d=this._isRightToLeft=$telerik.isRightToLeft(e);

    }return d;

    },_createStatusbarResizer:function(c){if(this.ui){this.ui.createStatusbarResizer();

    }},_createStatusbarMessageCell:function(e){var f=e.rows[0].insertCell(-1);

    f.style.width="100%";


    My code is similar to the code in the sample

    http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx#qsf-demo-source

    I have a nestedviewtemplate in a radgird that then has a radgrid in the nestedveiwtemplate.  This inner radgrid has a linkbutton in one of the columns that calls a javascript that does a MyRadWindow.show(); 

    The  MyRadWindow is positioned in the aspx code just after the main radgrid.

    I cannot seem to find any info about similar issues.  Any suggestions to finding the cause of this issue?

    Thanks

  2. Andy
    Andy avatar
    27 posts
    Member since:
    Nov 2010

    Posted 13 Dec 2013 Link to this post

    The one other unique thing that I forgot to mention is that the radgrid and radwindow are in a user control.  The form itself doesn't have any radwindows.

    Thanks,
    Andy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Dec 2013 Link to this post

    Hi  Andy,

    Please  have a look into the following code snippet which works fine at my end.

    ASCX:
    <telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" DataSourceID="SqlDataSource1"
        runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
        AllowPaging="True" PageSize="5" GridLines="None" ShowGroupPanel="true" OnItemCreated="RadGrid1_ItemCreated"
        OnItemCommand="RadGrid1_ItemCommand">
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="EmployeeID" AllowMultiColumnSorting="True"
            GroupLoadMode="Server">
            <NestedViewTemplate>
                   ...
            </NestedViewTemplate>
            <Columns>
                     ...
                <telerik:GridTemplateColumn HeaderText="Book">
                    <ItemTemplate>
                        <asp:LinkButton ID="BookButton" runat="server" Text="Book Now" OnClientClick="OnClientClick();return false;" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista">
    </telerik:RadWindowManager>
    <telerik:RadWindow ID="RadWindow1" runat="server" Title="User List Dialog"
        Height="500px" Width="300px" Left="150px" />

    JavaScript:
    <script type="text/javascript">
        function OnClientClick() {
            radopen(null, "RadWindow1");
                     //or
            var win = $find("<%=RadWindow1.ClientID %>");
            win.show();
        }
    </script>

    Thanks,
    Shinu.
Back to Top