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


    I want to access a pane and set it's content 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) {
    //            var splitter = GetRadSplitter();
    //            var pane = splitter.getPaneById("<%= PaneRight.ClientID %>");
    //            debugger;
                var contentPane = $find("<%= PaneRight.ClientID %>");
                if (!contentPane) return;
    <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">
            <telerik:RadSplitBar runat="server" ID="RadSplitBar1" CollapseMode="Forward" />
            <telerik:RadPane ID="PaneRight" runat="server" Scrolling="Both">

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


  2. Dobromir
    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 %>");

    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