This is a migrated thread and some comments may be shown as answers.

SlidingPane State on masterpage

10 Answers 218 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Per
Top achievements
Rank 1
Per asked on 22 Apr 2008, 03:23 PM
Hello,
after hours and hours trying to figure this out i know have to turn to the forum.

I have a master page containing a Splitter. Within a sliding pane i have my menu.
Now i just want to be able to preserve the splitter/slidingpane state whenever i click on a menu item. Somehow i cant get it to work. 

Following the guides and ideas on 
http://www.telerik.com/community/forums/thread/b311D-geege.aspx
 works but thats just a defult state i can maintain without using complex session code.

Is there a somehow easyway around this?
(setting=preservestateeventhoughitsfromamasterandcantkeepitsid ="true" :) )
or do i have to use session to get the states of my panels?


/confused

Why cant it just save its state!!! Help Telerik!!

master.master
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="master.master.cs" Inherits="contents_master" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Master</title> 
<link href="../css/main.css" rel="stylesheet" type="text/css" /> 
 
 
 
 
<asp:ContentPlaceHolder id="head" runat="server">  
</asp:ContentPlaceHolder> 
      
      
</head> 
 
<body> 
 
<form id="form1" runat="server">  
<table style="width: 100%">  
        <tr> 
            <td valign="top"><div id="mastheadVersionText">SalocSoft PBS v1.0 Beta<telerik:RadScriptManager   
                    ID="RadScriptManager1" Runat="server">  
                </telerik:RadScriptManager> 
                    </div></td>  
            <td valign="top" align="right">  
            <div id="logininfo">  
                <asp:Button runat="server" Text="Logga ut" id="btnLogout" onclick="btnLogout_Click" Font-Size="X-Small"></asp:Button> 
                  
            </div> 
            </td> 
        </tr> 
        <tr><td valign="top">  
        <div id="top_nav">  
        <asp:SiteMapPath id="SiteMapPath1" runat="server" Font-Names="Verdana" Font-Size="0.8em" PathSeparator=" > ">  
            <PathSeparatorStyle Font-Bold="True" ForeColor="Black" /> 
            <CurrentNodeStyle ForeColor="Black" /> 
            <NodeStyle Font-Bold="True" ForeColor="#666666" /> 
            <RootNodeStyle Font-Bold="True" ForeColor="#1C5E55" /> 
        </asp:SiteMapPath>  </div> 
            </td><td></td></tr>  
    </table> 
<telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%">  
    <telerik:RadPane ID="RadPane1" runat="server" Width="22px">  
        <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server">  
            <telerik:RadSlidingPane ID="RadSlidingPane1" runat="server">  
                <asp:HyperLink ID="hlTest1" runat="server"          
                            NavigateUrl="workerapplications/view_w_applications.aspx"   
                            Text="Test">  
                        </asp:HyperLink> 
               </telerik:RadSlidingPane> 
            <telerik:RadSlidingPane ID="RadSlidingPane2" runat="server">  
            </telerik:RadSlidingPane> 
        </telerik:RadSlidingZone> 
    </telerik:RadPane> 
    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" /> 
    <telerik:RadPane ID="RadPane2" runat="server" Width="100%">  
    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder> 
    </telerik:RadPane> 
</telerik:RadSplitter> 
      
      
 
          
</form> 
 
</body> 
 
</html> 

the files beeing lodaded inside the placeholder.
<%@ Page Language="C#" MasterPageFile="~/contents/master.master" AutoEventWireup="true" CodeFile="view_w_applications.aspx.cs" Inherits="contents_workerapplications_view_w_applications" Title="Untitled Page" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">  
</asp:Content> 


10 Answers, 1 is accepted

Sort by
0
Per
Top achievements
Rank 1
answered on 22 Apr 2008, 03:40 PM
This is the code displaying a treeview as well.

<
%@ Master Language="C#" AutoEventWireup="true" CodeFile="master.master.cs" Inherits="contents_master" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Master</title> 
<link href="../css/main.css" rel="stylesheet" type="text/css" /> 
 
 
 
 
<asp:ContentPlaceHolder id="head" runat="server">  
</asp:ContentPlaceHolder> 
      
      
</head> 
 
<body> 
 
<form id="form1" runat="server">  
<table style="width: 100%">  
        <tr> 
            <td valign="top"><div id="mastheadVersionText">Title</div></td>  
            <td valign="top" align="right">  
            <div id="logininfo">  
                <asp:Button runat="server" Text="Logga ut" id="btnLogout" onclick="btnLogout_Click" Font-Size="X-Small"></asp:Button> 
                  
            </div> 
            </td> 
        </tr> 
        <tr><td valign="top">  
        <div id="top_nav">  
        <asp:SiteMapPath id="SiteMapPath1" runat="server" Font-Names="Verdana" Font-Size="0.8em" PathSeparator=" > ">  
            <PathSeparatorStyle Font-Bold="True" ForeColor="Black" /> 
            <CurrentNodeStyle ForeColor="Black" /> 
            <NodeStyle Font-Bold="True" ForeColor="#666666" /> 
            <RootNodeStyle Font-Bold="True" ForeColor="#1C5E55" /> 
        </asp:SiteMapPath>  </div> 
            </td><td></td></tr>  
    </table> 
<telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%">  
    <telerik:RadPane ID="RadPane1" runat="server" Width="22px">  
        <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server">  
            <telerik:RadSlidingPane ID="RadSlidingPane1" runat="server" Title="Testmenu1">  
                <asp:HyperLink ID="hlTest1" runat="server"          
                            NavigateUrl="workerapplications/view_w_applications.aspx"   
                            Text="Test">  
                        </asp:HyperLink> 
               </telerik:RadSlidingPane> 
            <telerik:RadSlidingPane ID="RadSlidingPane2" runat="server" Title="Tree menu">  
                <telerik:RadTreeView ID="RadTreeView1" Runat="server"   
                    DataSourceID="SiteMapDataSource1" Skin="Outlook">  
                    <CollapseAnimation Duration="100" Type="OutQuint" /> 
                    <ExpandAnimation Duration="100" /> 
                </telerik:RadTreeView> 
                <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" /> 
            </telerik:RadSlidingPane> 
        </telerik:RadSlidingZone> 
    </telerik:RadPane> 
    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" /> 
    <telerik:RadPane ID="RadPane2" runat="server" Width="100%">  
    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder> 
    </telerik:RadPane> 
</telerik:RadSplitter> 
      
      
 
          
</form> 
 
</body> 
 
</html> 
0
Tsvetie
Telerik team
answered on 24 Apr 2008, 01:08 PM
Hello Perpan,
I cannot find the Menu control in the code you provided, but I suppose, you have the following scenario - you have a RadSlidingPane and in it, you have a RadMenu; when you click an item of the RadMenu, you initiate a postback; as soon as the page is loaded again, you expect the RadSlidingPane to be expanded/docked, as it was before the postback. Please correct me if I am wrong.

If this is the case, you should get that behavior without writing any code. In case I misunderstood your scenario, or you do not get the described result, please prepare and send us a simple running project, demonstrating the problem you have, together with detailed instructions how we can reproduce it on our side.

Best wishes,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Per
Top achievements
Rank 1
answered on 24 Apr 2008, 02:32 PM
That is correct,
in my respond i have another codeview also displaying the scenario but then with a  tree view in it. (Forgot to add it in the first example).

Now this is true, the state of the slidepanel should and do keep its state but only if i use and run it on a standalone aspx page. Not when i use it on a master page.

I have read other blogposts and forum threads about the issue but then it was on older versions of the splitter.

So the problem remains, i cant keep the state of the panel when using the splitter on a master page and opening content in a placeholder. To note here is that the tree menu actually keeps its state but not the slides.
0
Tsvetie
Telerik team
answered on 24 Apr 2008, 03:53 PM
Hi Perpan,
Do you mean, that the state of the RadSlidingPanes is persisted when you have a page without a master page, but is not persisted when the page has a master page?

In order to speed up the process of finding a solution, I would like to ask you again to send us a running project, demonstrating the problem.

Regards,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Per
Top achievements
Rank 1
answered on 24 Apr 2008, 04:05 PM
Well, yes. When i run the example below i get my nicely populated treeview from my sitemap. The treeview persist its state but the panels in the splitter are back to starting positions. (eg. not pinned or sized up).

Here is my master.master file
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="master.master.cs" Inherits="contents_master" %>    
    
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>    
    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
    
<html xmlns="http://www.w3.org/1999/xhtml">     
<head id="Head1" runat="server">     
    <title>Master</title>    
<link href="../css/main.css" rel="stylesheet" type="text/css" />    
    
    
    
    
<asp:ContentPlaceHolder id="head" runat="server">     
</asp:ContentPlaceHolder>    
         
         
</head>    
    
<body>    
    
<form id="form1" runat="server">     
<table style="width: 100%">     
        <tr>    
            <td valign="top"><div id="mastheadVersionText">Title<telerik:RadScriptManager   
                    ID="RadScriptManager1" Runat="server">  
                </telerik:RadScriptManager> 
                    </div></td>     
            <td valign="top" align="right">     
            <div id="logininfo">     
                <asp:Button runat="server" Text="Logga ut" id="btnLogout" onclick="btnLogout_Click" Font-Size="X-Small"></asp:Button>    
                     
            </div>    
            </td>    
        </tr>    
        <tr><td valign="top">     
        <div id="top_nav">     
        <asp:SiteMapPath id="SiteMapPath1" runat="server" Font-Names="Verdana" Font-Size="0.8em" PathSeparator=" > ">     
            <PathSeparatorStyle Font-Bold="True" ForeColor="Black" />    
            <CurrentNodeStyle ForeColor="Black" />    
            <NodeStyle Font-Bold="True" ForeColor="#666666" />    
            <RootNodeStyle Font-Bold="True" ForeColor="#1C5E55" />    
        </asp:SiteMapPath>  </div>    
            </td><td></td></tr>     
    </table>    
<telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%">     
    <telerik:RadPane ID="RadPane1" runat="server" Width="22px">     
        <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server">     
            <telerik:RadSlidingPane ID="RadSlidingPane1" runat="server" Title="Testmenu1">     
                <asp:HyperLink ID="hlTest1" runat="server"             
                            NavigateUrl="workerapplications/view_w_applications.aspx"      
                            Text="Test">     
                        </asp:HyperLink>    
               </telerik:RadSlidingPane>    
            <telerik:RadSlidingPane ID="RadSlidingPane2" runat="server" Title="Tree menu">     
                <telerik:RadTreeView ID="RadTreeView1" Runat="server"      
                    DataSourceID="SiteMapDataSource1" Skin="Outlook">     
                    <CollapseAnimation Duration="100" Type="OutQuint" />    
                    <ExpandAnimation Duration="100" />    
                </telerik:RadTreeView>    
                <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />    
            </telerik:RadSlidingPane>    
        </telerik:RadSlidingZone>    
    </telerik:RadPane>    
    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" />    
    <telerik:RadPane ID="RadPane2" runat="server" Width="100%">     
    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"></asp:ContentPlaceHolder>    
    </telerik:RadPane>    
</telerik:RadSplitter>    
         
         
    
             
</form>    
    
</body>    
    
</html>    
 


0
Per
Top achievements
Rank 1
answered on 25 Apr 2008, 07:03 PM
We have choosen to simply remove the master file and have now another setup. So we can close this thread trying to find the solution.
0
Tsvetie
Telerik team
answered on 29 Apr 2008, 08:49 AM
Hi Perpan,
I did test your code, but could not reproduce the problem on our side. I am happy that you were able to find a solution on your own, but in case you find the time to prepare and send us a running test project, we will do our best to find out what was causing the problem.

All the best,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Andrei Sinelnikov
Top achievements
Rank 1
answered on 27 Aug 2008, 04:30 PM
Hello,

I am not sure if this thread is still monitored, but let's give it a try.

I have exaclty the same issue as Perpan.

I am using ASP.NET_AJAX_2008_1_619 suite

If you need sample project to reproduce the behaviour please let me know where I should send it. But issue is quite staightforward, so you should be able to reproduce it on your own.

1. You have Master Page (MasterPage.Master) with RadSlidingPane and RadPanelBar:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="SlidingPaneState.MasterPage" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManagerMaster" runat="server">  
    </telerik:RadScriptManager> 
    <div> 
        <telerik:RadSplitter ID="RadSplitterMain" runat="server" Skin="Vista" Width="100%">  
            <telerik:RadPane ID="RadPaneLeft" runat="server" Width="22" Scrolling="None">  
                <telerik:RadSlidingZone ID="RadSlidingZoneCategories" runat="server" Width="22">  
                    <telerik:RadSlidingPane ID="RadSlidingPaneCategories" Title="Categories" runat="server" 
                        EnableResize="false" PersistScrollPosition="true">  
                        <telerik:RadPanelBar ID="RadPanelBarMenu" runat="server" Skin="Vista" Width="140px" PersistStateInCookie="true">  
                            <CollapseAnimation Duration="100" Type="None" /> 
                            <Items> 
                                <telerik:RadPanelItem runat="server" Text="Water">  
                                    <Items> 
                                        <telerik:RadPanelItem runat="server" Text="Lines" Height="21px">  
                                        <Items> 
                                            <telerik:RadPanelItem runat="server" Text="Item 1" Value="Item1" NavigateUrl="~/Pages/Asset.aspx" > 
                                            </telerik:RadPanelItem> 
                                            <telerik:RadPanelItem runat="server" Text="Item 2" Value="Item2" NavigateUrl="~/Pages/Asset.aspx" > 
                                            </telerik:RadPanelItem> 
                                        </Items> 
                                        </telerik:RadPanelItem> 
                                        <telerik:RadPanelItem runat="server" Text="Features" Height="21px">  
                                        </telerik:RadPanelItem> 
                                    </Items> 
                                </telerik:RadPanelItem> 
                                <telerik:RadPanelItem runat="server" Text="Storm">  
                                    <Items> 
                                        <telerik:RadPanelItem runat="server" Text="Lines">  
                                        </telerik:RadPanelItem> 
                                        <telerik:RadPanelItem runat="server" Text="Features">  
                                        </telerik:RadPanelItem> 
                                    </Items> 
                                </telerik:RadPanelItem> 
                            </Items> 
                            <ExpandAnimation Duration="100" Type="None" /> 
                        </telerik:RadPanelBar> 
                    </telerik:RadSlidingPane> 
                </telerik:RadSlidingZone> 
            </telerik:RadPane> 
            <telerik:RadSplitBar ID="RadSplitBarVertical" runat="server" CollapseMode="Forward" /> 
            <telerik:RadPane ID="RadPaneContent" runat="server">  
                <asp:ContentPlaceHolder ID="ContentPlaceHolderMain" runat="server">  
                </asp:ContentPlaceHolder> 
            </telerik:RadPane> 
        </telerik:RadSplitter> 
    </div> 
    </form> 
</body> 
</html> 
 

2. You have dummy Default.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SlidingPaneState.Default" %> 
<asp:Content ID="ContentMain" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">  
Hello  
</asp:Content> 
 

3. And the last, but not least - Asset.aspx with simple RadTabStrip and RadMultiPage (located in "~/Pages" folder - which is not that important, but just to let you know)
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Asset.aspx.cs" Inherits="SlidingPaneState.Pages.Asset" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">  
    <telerik:RadTabStrip ID="RadTabStripAssetManagement" runat="server" MultiPageID="RadMultiPageAssetManagement" 
        Skin="Vista" Orientation="HorizontalBottom">  
        <Tabs> 
            <telerik:RadTab runat="server" Text="Search" Value="Search">  
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Details" Value="Detail">  
            </telerik:RadTab> 
        </Tabs> 
    </telerik:RadTabStrip> 
    <telerik:RadMultiPage ID="RadMultiPageAssetManagement" runat="server">  
    </telerik:RadMultiPage> 
</asp:Content> 
 

That's it... Run it. OK. Set Default.aspx as start page ;-)

By default you see sliding pane in the collapsed state - you only see Categories button.

1. Mouse over Categories button
2. See sliding pane Categories expanded
3. Dock it (Click pin icon in the right top corner of the Categories sliding pane)!
4. Go down to the Water->Lines and click on Item1.
5. Voila! You just saw Asset.aspx. But previously docked sliding pane collapsed ;-(

That is the issue we were talking about. Is there a nice and easy way to persist sliding pane position during postbacks if sliding pane located on the master page.

I am looking for something similar to PersistStateInCookie property of the RadPanelBar


Thank you,

Andrei
0
Andrei Sinelnikov
Top achievements
Rank 1
answered on 27 Aug 2008, 08:48 PM
I think I found solution. All you have to do is set PostBackUrl to the Asset.aspx on RadPanelBar instead of specifying NavigateUrl on specific RadPanelItem.

Next challenge - how to allow postback only when Level 2 items has been clicked in the RadPanelBar. I guess I have to go to another forum for that :-)
0
Paul
Telerik team
answered on 28 Aug 2008, 03:37 PM
Hi Andrei,

Please find below a sampe code snippet that shows the needed approach

ASPX:
<form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
    <telerik:RadPanelBar ID="RadPanelBar1" runat="server" OnItemClick="RadPanelBar1_ItemClick">  
        <CollapseAnimation Duration="100" Type="None" /> 
        <Items> 
            <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1">  
                <Items> 
                    <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1">  
                        <Items> 
                            <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1">  
                            </telerik:RadPanelItem> 
                            <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 2">  
                            </telerik:RadPanelItem> 
                            <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 3">  
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelItem> 
                    <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 2">  
                    </telerik:RadPanelItem> 
                </Items> 
            </telerik:RadPanelItem> 
            <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2">  
                <Items> 
                    <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1">  
                    </telerik:RadPanelItem> 
                    <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 2">  
                        <Items> 
                            <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 1">  
                            </telerik:RadPanelItem> 
                            <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 2">  
                            </telerik:RadPanelItem> 
                            <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 3">  
                            </telerik:RadPanelItem> 
                            <telerik:RadPanelItem runat="server" Text="Child RadPanelItem 4">  
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelItem> 
                </Items> 
            </telerik:RadPanelItem> 
        </Items> 
        <ExpandAnimation Duration="100" Type="None" /> 
    </telerik:RadPanelBar> 
</form> 

Code-behind:
using System;  
using System.Data;  
using System.Configuration;  
using System.Collections;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
using Telerik.Web.UI;  
 
public partial class _Default : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        foreach (RadPanelItem level2Items in RadPanelBar1.GetAllItems())  
        {  
            if (level2Items.Level == 1)  
            {  
                level2Items.PostBack = true;  
            }  
            else 
            {  
                level2Items.PostBack = false;  
            }  
        }  
    }  
    protected void RadPanelBar1_ItemClick(object sender, RadPanelBarEventArgs e)  
    {  
 
    }  
}  
 


Kind regards,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Splitter
Asked by
Per
Top achievements
Rank 1
Answers by
Per
Top achievements
Rank 1
Tsvetie
Telerik team
Andrei Sinelnikov
Top achievements
Rank 1
Paul
Telerik team
Share this question
or