Trying to Programmatically Set DockedPaneId

8 posts, 1 answers
  1. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 07 May 2010 Link to this post

    I have a situation where a SlidingPane contains a treeview and 2 dropdown listboxes.  About half a second after the form loads, the Pane slides out from the left.  I like this effect.  The problem arises after each postback when the user has chosen an item in the tree or selected an item in one of the dropdown listboxes.  Since the form is posting back, the same slide out effect occurs.  This is annoying to the user.

    So to the SlidingPane control I added this event handler definition: OnClientExpanded="radSlidingPane_Expanded"

    Which then calls this:

          function radSlidingPane_Expanded(sender, args) {
            $("#<%= UpdatePanel1.ClientID %> #<%= radSlidingZone.ClientID %>").attr('DockedPaneId', 'radSlidingPane');
          }

    I'm using jQuery to get the SlidingZone object.  That part seems to work fine.  But apparently setting 'DockedPaneId' as I have doesn't forcibly dock the SlidingPane.  Note: I even tried specifying the longer version - 'ctl00_ContentPlaceHolder1_radSlidingPane' - but it didn't work either.

    What should I be doing to achieve the effect I'm looking for?

    Robert
  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 12 May 2010 Link to this post

    Hello,

    The reason for this effect is that the previously opened RadSlidingPane will be expanded automatically again after PostBack.

    If you want to remove the automatic expanding after PostBack you should set ExpandedPaneId to an empty string:
    RadSlidingZone.ExpandedPaneId = "";(for example -  in the Page_Load event)

    If you want to Dock a RadSlidingPane once the user opens it, you should set RadSlidingPane's property DockOnOpen to "true".

    In case that these suggestions are not suitable for your scenario, please describe in more details your goals and we will do our best to help you.

    Best wishes,
    Petio Petkov
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 12 May 2010 Link to this post

    Hi Petio,

    Thank you for your speedy response.  However, I'm not sure I explained my situation properly.  So I just created a video for you: http://pelalusa.com/Downloads/Public/SlidingPaneProblem.wmv

    Hopefully after you watch this you will better understand what I'm trying to achieve,

    Robert

  5. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 14 May 2010 Link to this post

    Hi Robert,

    The behavior you are experiencing is caused by the fact that, the RadSlidingPane is loaded collapsed, and then automatically expanded. I created a workaround for you, which will expand the SlidingPane without animation, if the RadSplitter is not loaded yet. Also, I set RadSplitter's VisibleDuringInit property to true.
    <%@ 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">
      
    <head id="Head1" runat="server">
        <title></title>
        <script type="text/javascript">
            var isSplitterLoaded = false;
            function SplitterLoad(splitter, args)
            {
                isSplitterLoaded = true;
            }
      
            function OnClientExpanding(slidingPane, args)
            {
                if (isSplitterLoaded == true)
                
                    slidingPane._animation = null;   
                    slidingPane._slideDuration = 300;
                }
                else
                {   
                    slidingPane._slideDuration = 0;
                }
            }
      
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
        <telerik:RadSplitter ID="RadSplitter1" runat="server" OnClientLoad="SplitterLoad" VisibleDuringInit="false" >
            <telerik:RadPane ID="RadPane1" runat="server"  Width="22">
                <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server" Width="22" ClickToOpen="true">
                    <telerik:RadSlidingPane ID="RadSlidingPane1" Title="RadSlidingPane1" runat="server" Width="190" MinWidth="120"
                    OnClientExpanding="OnClientExpanding">
                        <asp:Button ID="btnPostback" runat="server" Text="Postback" />
                    </telerik:RadSlidingPane>
                </telerik:RadSlidingZone>
            </telerik:RadPane>
            <telerik:RadPane ID="RadPane2" runat="server"></telerik:RadPane>
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="RadPane3" runat="server"></telerik:RadPane>
        </telerik:RadSplitter>
        </div>
        </form>
    </body>
    </html>

    Let us know if you have any other questions.

    Kind regards,
    Petio Petkov
    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.
  6. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 14 May 2010 Link to this post

    Petio,

    Which version of the TreeView are you using?  The one I'm trying out does not have an "OnClientExpanding" event handler for RadSlidingPane.

    Robert
  7. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 19 May 2010 Link to this post

    Hello rmdw,

    The OnClientExpanding event is equivalent to the OnClientBeforeExpand event in older versions - please use it instead.

    Kind regards,
    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.
  8. Robert
    Robert avatar
    253 posts
    Member since:
    Aug 2007

    Posted 30 Aug 2010 Link to this post

    Svetlina,

    What's the client-side property I can set or method I can call to force an expanding pane to dock?

    Note: I have no such property called 'DockOnOpen' in the version I'm testing.

    Robert
  9. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 02 Sep 2010 Link to this post

    Hello rmdw,

     To programmatically dock a RadPane with javascript you should obtain a reference to its parent RadSlidingZone and call its dockPane client method which is listed below:


    http://www.telerik.com/help/aspnet-ajax/splitter_clientsideradslidingzone.html

    Regards,
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017