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

RadSlidingPane does not remember Scroll Position

3 Answers 135 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Jones
Top achievements
Rank 1
Jones asked on 26 Apr 2010, 01:51 PM
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;  
        } 

3 Answers, 1 is accepted

Sort by
0
Jones
Top achievements
Rank 1
answered on 28 Apr 2010, 10:29 AM
Can anyone provide me a solution for my problem???
0
Accepted
Svetlina Anati
Telerik team
answered on 29 Apr 2010, 10:27 AM
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.
0
Jones
Top achievements
Rank 1
answered on 29 Apr 2010, 11:13 AM
Thanks Svetlina for the fix.
Tags
Splitter
Asked by
Jones
Top achievements
Rank 1
Answers by
Jones
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or