Second RadAjaxPanel does not show content on ajax request

2 posts, 0 answers
  1. Marc Schaaks
    Marc Schaaks avatar
    16 posts
    Member since:
    May 2010

    Posted 31 May 2010 Link to this post

    Hi,

    Somehow i do not get the following scenario to work:

    Within a RadPane I have 2 usercontrols. Each usercontrol contains a RadAjaxPanel that surrounds a RadGrid and a RadAjaxLoadingPanel that shows loading progress. Based on a client-side javascript event  one or the other RadAjaxPanel's ajaxRequest methods will be called and the enclosed grid will be loaded with data from a database.

    The problem is that only the first defined usercontrol will show a loading panel and displays the data. How can I solve this problem ?

    page code containing the usercontrol definitions:

     

     

     

    <telerik:RadPane ID="TelerikSearch_Level2BottomRadPane" runat="server" Scrolling="None">

     

     

     

    <Control:TelerikDocGrid runat="server" Id = "TelerikDocGrid_Control"/>

     

     

     

    <Control:TelerikCompGrid runat="server" Id = "TelerikCompGrid_Control" />

     

     

     

    </telerik:RadPane>


    code TelerikDocGrid user control:

        function TelerikDocGrid_UpdateGrid(e) {  
     
            //create ajaxrequest argument  
              
            var args = "CN_CLASS_CONCATENATE=" + e.CN_CLASS_CONCATENATE;  
            args += "#RelatedProjectObjectId=" + e.related_project_object_id;  
            args += "#RelatedProjectObjectType=" + e.related_project_object_type;  
            args += "#RevisionFilter=" + e.RevisionFilter;  
            if (e.Id != "") args += "#Id=" + e.Id;  
            if (e.Description != "") args += "#Description=" + e.Description;  
            if (e.CN_AUTHOR != "") args += "#CN_AUTHOR=" + e.CN_AUTHOR;  
            if (e.CN_CLIENT_DOCUMENT_ID != "") args += "#CN_CLIENT_DOCUMENT_ID=" + e.CN_CLIENT_DOCUMENT_ID;  
            if (e.CN_THIRD_PARTY_DOCUMENT_ID != "") args += "#CN_THIRD_PARTY_DOCUMENT_ID=" + e.CN_THIRD_PARTY_DOCUMENT_ID;  
            if (e.CN_AUTHOR_EXTERNAL != "") args += "#CN_AUTHOR_EXTERNAL=" + e.CN_AUTHOR_EXTERNAL;  
     
            var radpanel = $find("<%= TelerikDocGrid_RadAjaxPanel.ClientID %>");  
            radpanel.ajaxRequest(args);  
        }  
     
        function TelerikDocGrid_RowSelected(sender, eventArgs) {  
              
            //debugger   
     
            //var grid = sender;  
            //var MasterTable = grid.get_masterTableView();  
            //var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];  
            //var cell = MasterTable.getCellByColumnUniqueName(row, "column3");  
            //alert(cell.innerHTML); //here cell.innerHTML holds the value of the cell  
              
            //view document  
     
            var url = eventArgs.getDataKeyValue("DocumentViewUrl");  
            window.open(url);  
        }  
     
        function TelerikDocGrid_RowContextMenu(sender, eventArgs) {  
              
            currentDocumentViewUrl = eventArgs.getDataKeyValue("DocumentViewUrl");  
            currentDocumentDownloadUrl = eventArgs.getDataKeyValue("DocumentDownloadUrl");  
     
            var menu = $find("<%= TelerikDocGrid_Context_RadMenu.ClientID %>");  
            var evt = eventArgs.get_domEvent();  
            menu.show(evt);  
         
            //var index = eventArgs.get_itemIndexHierarchical();  
            //document.getElementById("radGridClickedRowIndex").value = index;  
     
            //sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);  
            evt.cancelBubble = true;  
            evt.returnValue = false;  
            if (evt.stopPropagation) {  
                evt.stopPropagation();  
                evt.preventDefault();  
            }  
        }  
     
     
        function TelerikDocGrid_RowContextMenu_ItemClicked(sender, eventArgs) {  
     
            var item = eventArgs.get_item();  
            var action = item.get_attributes().getAttribute("Action");  
     
            switch (action) {  
     
                case "view":  
                    window.open(currentDocumentViewUrl);  
                    break;  
                case "download":  
                    window.open(currentDocumentDownloadUrl);  
            }  
        }  
     
    </script> 
     
    </telerik:RadCodeBlock> 
     
    <telerik:RadAjaxLoadingPanel ID="TelerikDocGrid_RadAjaxLoadingPanel" runat="server" Skin="Default">  
    </telerik:RadAjaxLoadingPanel> 
     
    <telerik:RadAjaxPanel ID="TelerikDocGrid_RadAjaxPanel" runat="server"   
    Height="100%" Width="100%" OnAjaxRequest="TelerikDocGrid_AjaxRequest"   
    LoadingPanelID="TelerikDocGrid_RadAjaxLoadingPanel">  
     
        <telerik:RadGrid ID="TelerikDocGrid_RadGrid" runat="server" AllowSorting="True"   
            GridLines="None" Width="100%" Height="100%"   
            OnNeedDataSource="TelerikDocGrid_RadGrid_NeedDataSource" ShowFooter="True" 
            EnableEmbeddedSkins="true">  
            <ClientSettings Scrolling-AllowScroll="true" Scrolling-UseStaticHeaders="true"   
            EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">  
                <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                <Selecting AllowRowSelect="true" /> 
                <ClientEvents OnRowSelected="TelerikDocGrid_RowSelected" OnRowContextMenu="TelerikDocGrid_RowContextMenu"/>  
            </ClientSettings> 
            <MasterTableView AutoGenerateColumns="False" ShowFooter="True"   
            TableLayout="Fixed" ClientDataKeyNames="DocumentViewUrl,DocumentDownloadUrl">  
                <Columns> 
                    <telerik:GridBoundColumn DataField="ClassName"   
                        HeaderText="Document" UniqueName="column3" Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="TypeIconUrl"   
                        HeaderText="Document" UniqueName="column4"  Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="StateText"   
                        HeaderText="Document" UniqueName="column5"  Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="StateIconUrl"   
                        HeaderText="Document" UniqueName="column6"  Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Author"   
                        HeaderText="Owner" UniqueName="column8"  Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Department"   
                        HeaderText="Department" UniqueName="column9"  Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridTemplateColumn HeaderText="Document" UniqueName="TemplateColumn"   
                    DataField="DocumentName" Aggregate="Count" FooterText="Number of documents found: "   
                    SortExpression="DocumentName" ItemStyle-Wrap="false">  
                        <ItemTemplate> 
                            <asp:Image ID="Image1" runat="server" AlternateText='<%# Eval("ClassName") %>'   
                            ImageUrl='<%# Eval("TypeIconUrl") %>' ToolTip='<%# Eval("ClassName") %>' /> 
                            <asp:Image ID="Image2" runat="server" AlternateText='<%# Eval("StateText") %>'   
                            ImageUrl='<%# Eval("StateIconUrl") %>' ToolTip='<%# Eval("StateText") %>' />                                         
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("DocumentName") %>'></asp:Label> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="Description"   
                        HeaderText="Description" UniqueName="column1">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="MODIFICATION_DATE"   
                        HeaderText="Modified" UniqueName="column2" DataFormatString="{0:d}"   
                        DataType="System.DateTime" HeaderStyle-Width="100px"   
                        ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="CN_CLASS_LEVEL_LEAF"   
                        HeaderText="Classification" UniqueName="column" Visible="true">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn AutoPostBackOnFilter="True" DataField="ViState"   
                        HeaderText="VI State" UniqueName="column7"  DataType="System.String"   
                        HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Center"   
                        HeaderStyle-HorizontalAlign="Center">  
                    </telerik:GridBoundColumn> 
                </Columns> 
                <NestedViewTemplate> 
                    <div class="document-details">  
                        <ul> 
                            <li><label>Owner:</label><%# Eval("Author") %></li>  
                            <li><label>Department:</label><%# Eval("Department") %></li>  
                        </ul> 
                    </div> 
                </NestedViewTemplate> 
            </MasterTableView> 
            <GroupingSettings  CaseSensitive="false"/>  
        </telerik:RadGrid> 
        <telerik:RadContextMenu ID="TelerikDocGrid_Context_RadMenu" runat="server"   
        Skin="Default" EnableRoundedCorners="true" OnClientItemClicked="TelerikDocGrid_RowContextMenu_ItemClicked">  
            <Items> 
                <telerik:RadMenuItem Text="View document" Action="view"></telerik:RadMenuItem> 
                <telerik:RadMenuItem Text="Download document" Action="download"></telerik:RadMenuItem> 
            </Items> 
        </telerik:RadContextMenu> 
    </telerik:RadAjaxPanel> 

    The code concerning the TelerikCompGrid user control is more or less the same as the TelerikDocGrid user control.

    This one is bugging me for some time. Help is much appreciated.
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 03 Jun 2010 Link to this post

    Hi Marc,

    I suggest you to try showing and hiding the LoadingPanels for the both AjaxPanels explicitly as it shown in this helps topic. Test this approach and let me know if this makes any difference.


    Best wishes,
    Maria Ilieva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top