+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / RadTreeView disappears after postback.

RadTreeView disappears after postback.

2 posts, 0 answered
  1. Andy
    Andy avatar
    3 posts
    Registered:
    30 Apr 2013
    27 May 2013
    Link to this post
    I have a simple siteFinity page, left is a RadTreeView wrapped under a user control. The right side is another user control that holds content. The RadTreeView is also wrapped RadAjaxPanel. 
    However, when I click a button inside the ajaxpanel, teh radtreeview disappears after postback. 

    The page_load method: 
     protected void Page_Load(object sender, EventArgs e)
            {
                if (!this.IsPostBack)
                {
                        Populate_RadTreeView1(context)
                }
            }

    The RadTreeView ASPX code:

    <tg:SiteFinityAjaxPanel ID="siteFinityAjaxPanel1" runat="server" LoadingPanelID="radAjaxLoadingPanel1">
       <div id="leftContainer1">

    <asp:Label id="myDesignsLabel" style="cursor: pointer;"  Text="My Designs" runat="server" />
    <telerik:RadTreeView ID="RadTreeView1" runat="server" OnNodeDataBound="RadTreeView1_NodeDataBound" AllowNodeEditing="true" EnableViewState="true" OnClientNodeClicked="TreeNodeClicked" 
        OnNodeEdit="RadTreeView1_NodeEdit" EnableDragAndDrop="true"  OnNodeDrop="RadTreeView1_NodeDrop" > 
    </telerik:RadTreeView>

          
       <asp:Button ID="btnTreeRefresh"  runat="server" OnClick="btnTreeRefresh_Click" />
         
    </div>
    </tg:SiteFinityAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>


    Everything else works fine if I take away the isPostback check. But by doing that I lost all tree status. But I need to keep the tree status, please help.
  2. Andy
    Andy avatar
    3 posts
    Registered:
    30 Apr 2013
    27 May 2013 in reply to Andy
    Link to this post
    [More Information on the post] Checked the page source, the tree view is completely disappeared. 

    before the postback, the treeview:

    <div id="ctl00_ContentOneColumnPlaceHolder_C002_RadTreeView1" class="RadTreeView RadTreeView_Black">
    <ul class="rtUL rtLines">
    <li class="rtLI rtFirst"><div class="rtTop">
    <span class="rtSp"></span><span class="rtPlus"></span><span class="rtIn">First Project</span>
    </div><ul class="rtUL" style="display:none;">
    <li class="rtLI"><div class="rtTop">
    <span class="rtSp"></span><span class="rtIn">First Cloud Wall</span>
    </div></li><li class="rtLI"><div class="rtMid">
    <span class="rtSp"></span><span class="rtIn">second cloud wall</span>
    </div></li><li class="rtLI rtLast"><div class="rtBot">
    <span class="rtSp"></span><span class="rtIn">Third cloud wall</span>
    </div></li>
    </ul></li><li class="rtLI"><div class="rtMid">
    <span class="rtSp"></span><span class="rtPlus"></span><span class="rtIn">project added</span>
    </div><ul class="rtUL" style="display:none;">
    <li class="rtLI"><div class="rtTop">
    <span class="rtSp"></span><span class="rtIn">CloudWall</span>
    </div></li><li class="rtLI"><div class="rtMid">
    <span class="rtSp"></span><span class="rtIn">CloudWall</span>
    </div></li><li class="rtLI rtLast"><div class="rtBot">
    <span class="rtSp"></span><span class="rtIn">CloudWall</span>
    </div></li>
    </ul></li><li class="rtLI rtLast"><div class="rtBot">
    <span class="rtSp"></span><span class="rtIn">New Project</span>
    </div></li>
    </ul><input id="ctl00_ContentOneColumnPlaceHolder_C002_RadTreeView1_ClientState" name="ctl00_ContentOneColumnPlaceHolder_C002_RadTreeView1_ClientState" type="hidden" />
    </div>


    After postback:
    <div id="ctl00_ContentOneColumnPlaceHolder_C002_RadTreeView1" class="RadTreeView RadTreeView_Black">
    <input id="ctl00_ContentOneColumnPlaceHolder_C002_RadTreeView1_ClientState" name="ctl00_ContentOneColumnPlaceHolder_C002_RadTreeView1_ClientState" type="hidden" />
    </div>
2 posts, 0 answered