can't access pane by getPaneById

2 posts, 0 answers
  1. xie yufei
    xie yufei avatar
    14 posts
    Member since:
    Sep 2009

    Posted 02 Apr 2011 Link to this post

    Dear,

    I want to access a pane and set it's content url.it works by using

    var contentPane = $find("<%= PaneRight.ClientID %>");
    and not works by using
    var splitter = GetRadSplitter();
    var pane = splitter.getPaneById("PaneRight");

    the page source below
    <%@ Page Title="" Language="C#" MasterPageFile="~/Common/Base.Master" AutoEventWireup="true"
        CodeBehind="RptAuth.aspx.cs" Inherits="Rp.UI.ReportManager.RptAuth" %>
      
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
      
        <script type="text/javascript" language="javascript">
            function GetRadSplitter() {
                return $find("<%= RadSplitter1.ClientID %>");
            }
      
            function tvClientNodeClicked(sender, eventArgs) {
                var node = eventArgs.get_node();
                if (node.get_nodes().get_count() > 0) {
                    return;
                }
    //            var splitter = GetRadSplitter();
    //            var pane = splitter.getPaneById("<%= PaneRight.ClientID %>");
    //            debugger;
                var contentPane = $find("<%= PaneRight.ClientID %>");
                if (!contentPane) return;
      
                     }
        </script>
      
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Vertical" BorderSize="0"
            BorderStyle="None" Height="100%" Width="100%">
            <telerik:RadPane ID="PaneLeft" runat="server" Scrolling="None" Height="100%" Width="180px">
                <div style="border-top-style: solid; border-top-width: 1px; border-top-color: #3333CC">
                    <telerik:RadTreeView ID="tvUser" Height="100%" Width="100%" runat="server" OnClientNodeClicked="tvClientNodeClicked">
                        <Nodes>
                                       </div>
            </telerik:RadPane>
            <telerik:RadSplitBar runat="server" ID="RadSplitBar1" CollapseMode="Forward" />
            <telerik:RadPane ID="PaneRight" runat="server" Scrolling="Both">
            </telerik:RadPane>
        </telerik:RadSplitter>
    </asp:Content>

    I noticed that all the demo have used the second way to access the specified pane.how to fix my code?

    thanks

    Kevin
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 04 Apr 2011 Link to this post

    Hi Kevin,

    In order to get reference to a RadPane using RadSplitter's getPaneById() client-side method, you need to provide the clientId of the pane. Please note that the ContentPlaceHolders are naming containers and the clientId of the controls inside are modified, thus you need to pass the RadPane's clientId to the method, e.g.:
    var splitter = GetRadSplitter();
    var pane = splitter.getPaneById("<%=PaneRight.ClientID %>");


    Greetings,
    Dobromir
    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
Back to Top