Control Undefined error on RadtreeList Page number click

2 posts, 0 answers
  1. Kimi
    Kimi avatar
    1 posts
    Member since:
    May 2012

    Posted 04 May 2012 Link to this post

    Hey Guys

    I am using RadTreeList and doing the hierarchical binding of data by keeping that in the update panel and doing server side binding using AjaxManager and keep the paging enabled.
    Whenever I click on any page number or Group(-) Image on the top left of the tree list it throws java script error and treelist got crashed and is unable to find the id of the treeview in update panel and shows control undefined
    Is there any other way to group the data on the basis of 'ParentI3D' and having sorting and paging functionality enabled

    Here is the design of my treelist:

    <asp:UpdatePanel ID="upPanel" runat="server" UpdateMode="Always">                     <ContentTemplate>                           <telerik:RadTreeList ID="gvCustomerMonitorFailures" runat="server" ParentDataKeyNames="ParentI3D"                         ClientIDMode="Static" DataKeyNames="I3D" AllowPaging="true" PageSize="5" AutoGenerateColumns="false"                         AllowSorting="true" ShowTreeLines="false" GridLines="None" AllowMultiItemSelection="true">                         <ClientSettings Selecting-AllowItemSelection="false">                             <ClientEvents OnItemSelected="gvCustomerMonitorFailures_OnItemSelected" OnItemClick="gvCustomerMonitorFailures_OnItemClick">                             </ClientEvents>                         </ClientSettings>                         <Columns>                             <telerik:TreeListBoundColumn DataField="DisplayName" UniqueName="DisplayName" HeaderText=""                                 HeaderStyle-Width="35px" />                             <telerik:TreeListTemplateColumn DataField="IsCheck" UniqueName="IsCheck" HeaderText="">                                 <ItemTemplate>                                     <img src='<%# ProcessMyDataItem(Eval("IsCheck")) %>' id="DisplayIsDeleted" alt=""                                         style="margin-left5pxmargin-top5pxwidth16pxheight16px;" />                                 </ItemTemplate>                                 <HeaderStyle Width="35px" />                                 <ItemStyle HorizontalAlign="Center" />                             </telerik:TreeListTemplateColumn>                             <telerik:TreeListTemplateColumn DataField="IsProblems" UniqueName="IsProblems" HeaderText="">                                 <ItemTemplate>                                     <img src='<%# ProcessMyDataItem(Eval("IsProblems")) %>' id="DisplayIsDeleted" alt=""                                         style="margin-left5pxmargin-top5pxwidth16pxheight16px;" />                                 </ItemTemplate>                                 <HeaderStyle Width="35px" />                                 <ItemStyle HorizontalAlign="Center" />                             </telerik:TreeListTemplateColumn>                             <telerik:TreeListTemplateColumn DataField="IsProcessorPerformance" UniqueName="IsProcessorPerformance"                                 HeaderText="">                                 <ItemTemplate>                                     <img src='<%# ProcessMyDataItem(Eval("IsProcessorPerformance")) %>' id="DisplayIsDeleted"                                         alt="" style="margin-left5pxmargin-top5pxwidth16pxheight16px;" />                                 </ItemTemplate>                                 <HeaderStyle Width="35px" />                                 <ItemStyle HorizontalAlign="Center" />                             </telerik:TreeListTemplateColumn>                             <telerik:TreeListBoundColumn DataField="Description" UniqueName="Description" HeaderText="<%$ Resources:CEntronResource, clmDescription %>">                                 <ItemStyle HorizontalAlign="Right" />                             </telerik:TreeListBoundColumn>                             <telerik:TreeListBoundColumn DataField="StartAsString" UniqueName="StartAsString"                                 HeaderText="<%$ Resources:CEntronResource, clmStart %>" />                             <telerik:TreeListBoundColumn DataField="FinishAsString" UniqueName="FinishAsString"                                 HeaderText="<%$ Resources:CEntronResource, clmFinish %>" />                             <telerik:TreeListBoundColumn DataField="Time" UniqueName="Time" HeaderText="<%$ Resources:CEntronResource, clmTime %>" />                             <telerik:TreeListBoundColumn DataField="FailureReason" UniqueName="FailureReason"                                 HeaderText="<%$ Resources:CEntronResource, clmFailureReason %>" />                         </Columns>                     </telerik:RadTreeList>                                                    </ContentTemplate>                 </asp:UpdatePanel>
    
    
    
    
    Here is the Ajax request event which I used to call on my another control click:
    
          /// <summary>
            /// Handles the AjaxRequest event of the RadAjaxManager1 control.
            /// </summary>
            /// <param name="sender">The source of the event.</param>
            /// <param name="e">The <see cref="Telerik.Web.UI.AjaxRequestEventArgs"/> instance containing the event data.</param>
            protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
            {
                  
                //UserControl treelist = (UserControl)this.FindControl("serverComptDetailsView");
                UpdatePanel updPanel = (UpdatePanel)serverComptDetailsView.FindControl("upPanel");
                RadTreeList treelist = (RadTreeList)serverComptDetailsView.FindControl("gvCustomerMonitorFailures");
               
                CEntronRestServiceClient serviceClient = new CEntronRestServiceClient();
                RequestOfint request = new RequestOfint();
                request.Data = Convert.ToInt32(e.Argument.ToString());
                ResponseOfMonitoringDataFailureDTOHGZ00jlC response = new ResponseOfMonitoringDataFailureDTOHGZ00jlC();
                response = serviceClient.GetMonitoringDataFailureDetailByDeviceID(request);

                treelist.DataSource = response.Result;

            
            }
  2. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 09 May 2012 Link to this post

    Hi Kimi,

    I tried to replicate the issue which you described, but to no avail. Attached to this message, you will find the code which I used for testing. Please, take a look at it and let me know if there are any differences at your end, which I may be leaving out.

    Additionally, from the provided code it seems you are using both RadAjaxManager and UpdatePanel which is not supported scenario and could cause unexpected behavior as it is stated in the help article below:

    Kind regards,
    Antonio Stoilkov
    the Telerik team
    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 their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top