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

Trying to Programmatically Set DockedPaneId

7 Answers 121 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 08 May 2010, 12:23 AM
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

7 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 12 May 2010, 03:03 PM
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.
0
Robert
Top achievements
Rank 1
answered on 12 May 2010, 08:12 PM
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

0
Petio Petkov
Telerik team
answered on 14 May 2010, 01:07 PM
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.
0
Robert
Top achievements
Rank 1
answered on 14 May 2010, 06:09 PM
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
0
Svetlina Anati
Telerik team
answered on 19 May 2010, 02:03 PM
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.
0
Robert
Top achievements
Rank 1
answered on 31 Aug 2010, 04:24 AM
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
0
Accepted
Svetlina Anati
Telerik team
answered on 02 Sep 2010, 10:08 AM
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
Tags
Splitter
Asked by
Robert
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Robert
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or