RadSlidingPane does not remember Scroll Position

4 posts, 1 answers
  1. Jones
    Jones avatar
    5 posts
    Member since:
    Apr 2010

    Posted 26 Apr 2010 Link to this post

    I have a RadSlidingPane with its PersistScrollPosition set to true.  However, when I scroll to a particular position and collapse the SlidingPane and later when I open it, it takes me to the top of the content in the SlidingPane.  Am I missing something?

    I'm using Q3 2009 SP2

    Here is my .aspx code

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Telerik._Default" %> 
     
     
    <!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">  
    <style type="text/css">  
    html, body, form  
    {  
        height: 100%;  
        margin: 0px;  
        padding: 0px;  
        overflow: hidden;  
        font-size: 9px;  
        font-family: Verdana;  
    }  
    </style> 
     
    </head> 
    <body> 
        <form id="frmDefault" runat="server">  
              
            <asp:ScriptManager ID="smgrMain" runat="server" /> 
     
            <div id="dvMain" style="height: 100%;">  
                <telerik:RadSplitter   
                    ID="splMain"   
                    runat="server"   
                    Orientation="Horizontal"   
                    Height="100%" 
                    Width="100%" 
                    BorderSize="0" 
                    VisibleDuringInit="false"   
                    ResizeWithBrowserWindow="true"   
                    Skin="Office2007">  
                    <telerik:RadPane   
                        ID="paneTop"   
                        runat="server"   
                        Height="50"   
                        Locked="true" 
                        Scrolling="none">  
                        Header  
                    </telerik:RadPane> 
                    <telerik:RadPane   
                        ID="paneLeftRight"   
                        runat="server"   
                        Scrolling="None"   
                        MinWidth="500">  
                        <telerik:RadSplitter   
                            ID="splLeftRight"   
                            runat="server"   
                            Skin="Office2007" 
                            VisibleDuringInit="false"   
                            ResizeWithBrowserWindow="true" 
                            ResizeWithParentPane="true" 
                            LiveResize="true">  
                            <telerik:RadPane   
                                ID="paneLeft"   
                                runat="server"   
                                Width="20" 
                                MinWidth="120"   
                                MaxWidth="300"   
                                Scrolling="None">  
                                <telerik:RadSlidingZone ID="slzLeft" runat="server" ClickToOpen="false">  
                                    <telerik:RadSlidingPane   
                                        ID="slpFirst"   
                                        runat="server"   
                                        Title="First"   
                                        DockText="First" 
                                        UndockText="First"   
                                        PersistScrollPosition="true" 
                                        Width="250">  
                                        <asp:Literal ID="litTest" runat="server" /> 
                                    </telerik:RadSlidingPane> 
                                    <telerik:RadSlidingPane ID="slpSecond" runat="server" Title="Second" Width="250px"/>  
                                </telerik:RadSlidingZone> 
                            </telerik:RadPane> 
                            <telerik:RadSplitBar ID="spbLeftRight" runat="server" /> 
                            <telerik:RadPane ID="paneRight" runat="server" ContentUrl="about:Blank" Scrolling="Both"/>  
                        </telerik:RadSplitter> 
                    </telerik:RadPane> 
                </telerik:RadSplitter> 
            </div> 
        </form> 
    </body> 
    </html> 
     

    And my codebehind

    protected void Page_Load(object sender, EventArgs e)  
            {  
                string strData = string.Empty;  
                for (int intCounter = 0; intCounter < 500; intCounter++)  
                {  
                    strData += intCounter + "<br />";  
                }  
                litTest.Text = strData;  
            } 
  2. Jones
    Jones avatar
    5 posts
    Member since:
    Apr 2010

    Posted 28 Apr 2010 Link to this post

    Can anyone provide me a solution for my problem???
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 29 Apr 2010 Link to this post

    Hello Jones,

    Thank you for the provided code, I built up a test demo based on it and I was able to reproduce the problem which turned out to be in the source code. The problem is already fixed and the fix will be available in the next internal build as well as in all later builds.

    For the time being I suggest to use the following workaround;



    <script type="text/javascript">
           function OnClientCollapsing(sender, args)
           {
               var scrollPos = sender.getScrollPos();
               sender._scrollTop = scrollPos.top;
               sender._scrollLeft = scrollPos.left;            
           }
         
       </script>
       <div id="dvMain" style="height: 100%;">
           <telerik:RadSplitter ID="splMain" runat="server" Orientation="Horizontal" Height="100%"
               Width="100%" BorderSize="0" VisibleDuringInit="false" ResizeWithBrowserWindow="true"
               Skin="Office2007">
               <telerik:RadPane ID="paneTop" runat="server" Height="50" Locked="true" Scrolling="none">
                   Header
               </telerik:RadPane>
               <telerik:RadPane ID="paneLeftRight" runat="server" Scrolling="None" MinWidth="500">
                   <telerik:RadSplitter ID="splLeftRight" runat="server" Skin="Office2007" VisibleDuringInit="false"
                       ResizeWithBrowserWindow="true" ResizeWithParentPane="true" LiveResize="true">
                       <telerik:RadPane ID="paneLeft" runat="server" Width="20" MinWidth="120" MaxWidth="300"
                           Scrolling="None">
                           <telerik:RadSlidingZone ID="slzLeft" runat="server" ClickToOpen="false">
                               <telerik:RadSlidingPane ID="slpFirst" runat="server" Title="First" DockText="First"
                                   UndockText="First" PersistScrollPosition="true" Width="250" OnClientCollapsing="OnClientCollapsing">
                                   <asp:Literal ID="litTest" runat="server" />
                               </telerik:RadSlidingPane>
                               <telerik:RadSlidingPane ID="slpSecond" runat="server" Title="Second" Width="250px" />
                           </telerik:RadSlidingZone>
                       </telerik:RadPane>
                       <telerik:RadSplitBar ID="spbLeftRight" runat="server" />
                       <telerik:RadPane ID="paneRight" runat="server" ContentUrl="about:Blank" Scrolling="Both" />
                   </telerik:RadSplitter>
               </telerik:RadPane>
           </telerik:RadSplitter>
       </div>

    Note, that the workaround uses private properties which is not a good practice and thus we strongly recommend to upgrade to the fixed version when it is available and to remove the workaround.

    I attached a sample page for your convenience and I also updated your account with some Telerik points for your kind cooperation.

    Best wishes,
    Svetlina
    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.
  5. Jones
    Jones avatar
    5 posts
    Member since:
    Apr 2010

    Posted 29 Apr 2010 Link to this post

    Thanks Svetlina for the fix.
Back to Top