RadTreeList isn't loading on page load

2 posts, 0 answers
  1. Roukaya
    Roukaya avatar
    17 posts
    Member since:
    Aug 2012

    Posted 08 May 2013 Link to this post

    I'm having a problem in radtreelist and it isn't loading on page load the radtreelist is inside a radmultipage the code is like this :
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
                            SelectedIndex="0" ReorderTabsOnSelect="true" Align="Justify" Width="220px"  >
                            <Tabs>
       <telerik:RadTab Text="<%$Resources:Strings,Stores %>" >
                                </telerik:RadTab>
       <telerik:RadMultiPage ID="RadMultiPage1" runat="server" Width="100%">
       <telerik:RadPageView ID="StoresPageView" runat="server">
                            <telerik:RadAjaxPanel ID="Ajpanel" runat="server">
                               <telerik:RadTreeList ID="StoreTreeList" runat="server"   HideExpandCollapseButtonIfNoChildren="true"
                                    ParentDataKeyNames="PARENT_STORE_ID" DataKeyNames="STORE_ID" AllowPaging="false" GridLines="Horizontal"
                                    AutoGenerateColumns="false" AllowSorting="true" AllowMultiItemSelection="true" OnNeedDataSource="StoreTreeList_NeedDataSource">
                                    <ItemStyle  HorizontalAlign="Left" />
                                   <ClientSettings><Scrolling UseStaticHeaders="true"  AllowScroll="true"  /> </ClientSettings>
                                    <Columns>
     
                                        <telerik:TreeListSelectColumn  ></telerik:TreeListSelectColumn>
                                        <telerik:TreeListTemplateColumn  Display="false" >
                                        <ItemTemplate>
                                        <asp:HiddenField ID="hf_StoreID" runat="server" Value='<%# Eval("STORE_ID") %>' />
                                        </ItemTemplate>
                                        </telerik:TreeListTemplateColumn>
                                        <telerik:TreeListBoundColumn DataField="STORE_NAME" HeaderText="Stores" >
                                        </telerik:TreeListBoundColumn>
     
                                    </Columns>
                                </telerik:RadTreeList>
                             </telerik:RadAjaxPanel>
                            </telerik:RadPageView>
    server side :
    protected void StoreTreeList_NeedDataSource(object sender,TreeListNeedDataSourceEventArgs e)
    {
        BindTreeList();
     
    }
     
      private void BindTreeList()
     {
     
       StoresDT.Select("STORE_ID=" + new WebSiteDataHelper().SelectedStoreID.Value)[0]["PARENT_STORE_ID"] = 0;
       StoreTreeList.DataSource = StoresDT;
     }
      protected void Page_Load(object sender, EventArgs e)
      {
       if (!IsPostBack)
        {
              StoreTreeList.ExpandAllItems();
        }
      }
  2. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 10 May 2013 Link to this post

    Hi Roukaya,

    Could you please elaborate a little bit more on your scenario? I prepared a small sample based on your code and attached it to this thread. Please give it a try and let me know how it differs from your real setup.

    Kind regards,
    Kostadin
    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