Panelbar cannot expand with custom user control (radtextbox, raddatepicker, radTextbox)

3 posts, 0 answers
  1. Cloud
    Cloud avatar
    24 posts
    Member since:
    Oct 2008

    Posted 16 Jul 2012 Link to this post

    HI, i tried to use the radpanelbar to build with my asp.net page. one of my panel item with a custom user control and the custom user control combin with multi control (radtextbox, radButton, raddatapicker and radtextbox). i found the panel bar cannot expand if i use custom user control with controls combin of radtextbox, radButton, raddatapicker and radtextbox and load the control in code behind. the issue is not occur if i don't use custom user control.

    custom user control

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProspectSearchCtl.ascx.cs" Inherits="Control_SearchControl_ProspectSearchCtl" %>
      
    <telerik:RadComboBox ID="RadComboBox2" runat="server">
    </telerik:RadComboBox>
    <telerik:RadDateInput ID="RadDateInput2" runat="server">
    </telerik:RadDateInput>
    <telerik:RadTextBox ID="RadTextBox2" runat="server">
    </telerik:RadTextBox>

    Main_New.aspx
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Main_New.aspx.cs" Inherits="STEPS_Pages_EditForm_Edit_MySearch"  %>
      
    <%@ Register src="~/Control/ClientSelectCtl.ascx" tagname="ClientSelectCtl" tagprefix="uc1" %>
      
    <%@ Register src="~/Control/ClientRegCtl.ascx" tagname="ClientRegCtl" tagprefix="uc2" %>
      
    <%@ Register src="~/Control/TransactionSearchCtl.ascx" tagname="TransactionSearchCtl" tagprefix="uc3" %>
      
    <%@ Register src="~/Control/TransactionSearchResultCtl.ascx" tagname="TransactionSearchResultCtl" tagprefix="uc4" %>
      
    <%@ Register src="../Control/SearchControl/ProspectSearchCtl.ascx" tagname="ProspectSearchCtl" tagprefix="uc5" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
    <head runat="server">
        <title></title>
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
        <base target="_self">
        <style type="text/css" >
             html, body, form  
        {  
            height: 100%;  
            margin: 0px;  
            padding: 0px;  
            overflow: hidden;  
        }  
        </style>
        <style type="text/css"
        * + html .buttonsPane
        {
            position: relative;
        }
    </style>
      
        <link href="~/css/common2.css" type="text/css" rel="stylesheet"/> 
          
    </head>
    <body >
    <script language="javascript" type="text/javascript">
        function spbLeft_OnClientItemClicked(sender, args) {
            var selectedPanelBar = args.get_item().get_value();
            var mpgMain = $find("<%= mpgMain.ClientID %>");
            if (selectedPanelBar == "Stock") {
                mpgMain.set_selectedIndex(0);
            } else if (selectedPanelBar == "Client") {
                mpgMain.set_selectedIndex(1);
            } else if (selectedPanelBar == "Global") {
                mpgMain.set_selectedIndex(2);
            } else if (selectedPanelBar == "Invoice") {
                mpgMain.set_selectedIndex(3);
            } else if (selectedPanelBar == "Building") {
                mpgMain.set_selectedIndex(4);
            } else if (selectedPanelBar == "Prospect") {
                mpgMain.set_selectedIndex(5);
            } else if (selectedPanelBar == "Transaction") {
                mpgMain.set_selectedIndex(6);
            } else if (selectedPanelBar == "Report") {
                mpgMain.set_selectedIndex(7);
            } else if (selectedPanelBar == "Profile") {
                mpgMain.set_selectedIndex(8);
            }
        }
        </script>
        <form id="form1" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            </telerik:RadScriptManager>
            <div style="height:100%; overflow:hidden"
                <telerik:RadSplitter ID="sptMainFrame" runat="server" Orientation="Vertical" SplitBarsSize=""  Width="100%" Height="100%">
                    <telerik:RadPane ID="splLeft" runat="server" Width="200px" Visible="true" >
                        <telerik:RadPanelBar 
                            runat="server" ID="spbLeft"
                            Height="100%" ExpandMode="FullExpandedItem" Width="200px" OnClientItemClicked="spbLeft_OnClientItemClicked">
                            <Items>
                                <telerik:RadPanelItem Text="Stock"  Expanded="true" Value="Stock" Visible="false" ImageUrl="~/Images/Home_16x16.png"  >
                                      
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Company/Contact"  Expanded="true" Value="Client" Visible="false" ImageUrl="~/images/User_16x16.png" >
                                      
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Global"  Expanded="true" Value="Global" Visible="false" ImageUrl="~/Images/global_16x16.PNG">
                                      
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Invoice"  Expanded="true" Value="Invoice" Visible="false" ImageUrl="~/Images/Invoice_16x16.PNG">
                                      
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Building"  Expanded="true" Value="Building" Visible="false" ImageUrl="~/Images/hospital-icon_16x16.png">
                                    <Items>
                                        <telerik:RadPanelItem >
                                           <ItemTemplate>
                                      
                                               <asp:Button ID="Button1" runat="server" Text="Button" />
                                           </ItemTemplate>
                                        </telerik:RadPanelItem>
                                    </Items>
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="My Prospects"   Value="Prospect" Visible="false" ImageUrl="~/Images/Invoice_16x16.PNG">
                                    <Items>
                                        <telerik:RadPanelItem Value="ProspectSearch" >
                                            <Items>
                                                <telerik:RadPanelItem runat="server" Value="ProspectSearchTemplateHolder" >   
                                                      
                                                </telerik:RadPanelItem
                                            </Items>
                                        </telerik:RadPanelItem>
                                    </Items>
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Transaction"  Expanded="true" Value="Transaction" Visible="false" ImageUrl="~/Images/Invoice_16x16.PNG">
                                      
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Reports"  Expanded="true" Value="Report" Visible="false" ImageUrl="~/Images/Invoice_16x16.PNG">
                                     
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="My Profile"  Expanded="true" Value="Profile" Visible="false" ImageUrl="~/Images/MyProfile_16x16.PNG">
                                      
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem runat="server" >
                                    <ItemTemplate>
                                        <asp:Image ID="imgSavillsTechnology" Width="180px" runat="server" ImageUrl="~/Images/savillsTechnology_jpg_Resize.jpg" />
                                    </ItemTemplate>
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelBar>
                    </telerik:RadPane>
                    <telerik:RadPane ID="splMain" runat="server" Width="100%" CssClass="buttonsPane" Scrolling="None" Height="100%">
                        <telerik:RadMultiPage ID="mpgMain" runat="server" SelectedIndex="0">
                            <telerik:RadPageView ID="pvwStock" runat="server"  >
                            stock
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pvwClient" runat="server">
                            client
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pvwGlobal" runat="server">
                            global
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pvwInvoice" runat="server">
                            invoice
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pvwBuilding" runat="server">
                            building
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pvwProspect" runat="server">
                            prospect
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pvwTransaction" runat="server">
                            transaction
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pvwReport" runat="server">
                            report
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pvwMyProfile" runat="server">
                            profile
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </div>
            <telerik:RadAjaxManager runat="server">
            </telerik:RadAjaxManager>
              
        </form>
    </body>
    </html>


    Main_New.aspx.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
      
    using Savills.Web;
    using Savills.DataSource;
    using Telerik.Web.UI;
      
    public partial class STEPS_Pages_EditForm_Edit_MySearch : CommonPage
    {
      
        //private long? _recordId = null;
        private long? _mySearchId = null;
        private long _clientId;
        private long? _assoClientId;
        private string _action = null;
        private bool _isCreateNewMySearch = false;
        private bool _isShowClientInfo = true;
        private string _menu = null;
        private string _multiLocationList = null;
        private string _leaseStatus = null;
        private string _tenureType = null;
        private bool _showSearchPane = true;
        private string _fromCond = null;
      
        #region properties
        //protected long? RecordId { 
        //    get { return _recordId ; }
        //    set { _recordId = value; }
        //}
        protected long? MySearchId
        {
            get { return _mySearchId; }
            set { _mySearchId = value; }
        }
        protected long ClientId {
            get { return _clientId; }
            set { _clientId = value; }
        }
        protected long? AssoClientId
        {
            get { return _assoClientId; }
            set { _assoClientId = value; }
        }
        protected string Action {
            get { return _action; }
            set { _action = value; }
        }
        public string multiLocationList
        {
            get { return _multiLocationList; }
            set { _multiLocationList = value; }
        }
        public string leaseStatus
        {
            get { return _leaseStatus; }
            set { _leaseStatus = value; }
        }
        public string tenureType
        {
            get { return _tenureType; }
            set { _tenureType = value; }
        }
        public bool showSearchPane
        {
            get { return _showSearchPane; }
            set { _showSearchPane = value; }
        }
        public string fromCond
        {
            get { return _fromCond; }
            set { _fromCond = value; }
        }
      
        protected string IsCreateNewMySearch
        {
            get { return _action; }
            set { _action = value; }
        }
      
        protected bool isShowClientInfo
        {
            get { return _isShowClientInfo; }
            set { _isShowClientInfo = value; }
        }
        #endregion
      
        #region page events
        protected void Page_Init(object sender, EventArgs e)
        {
            //if (Page.IsPostBack)
            //{
                //initForm();
            //}
        }
      
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
            Response.Cache.SetNoStore();
      
            if (Page.IsPostBack)
            {
                //if (ViewState["RecordId"] != null) {
                //    _recordId = long.Parse(ViewState["RecordId"].ToString());
                //}
      
                if (ViewState["MySearchId"] != null)
                {
                    _mySearchId = long.Parse(ViewState["MySearchId"].ToString());
                }
      
                if (ViewState["ClientId"] != null)
                {
                    _clientId = long.Parse(ViewState["ClientId"].ToString());
                }
                if (ViewState["AssoClientId"] != null)
                {
                    _assoClientId = long.Parse(ViewState["AssoClientId"].ToString());
                }
                if (ViewState["Action"] != null)
                {
                    _action = ViewState["Action"].ToString();
                }
                if (ViewState["IsCreateNewMySearch"] != null)
                {
                    _isCreateNewMySearch = (bool)ViewState["IsCreateNewMySearch"];
                }
                if (ViewState["IsShowClientInfo"] != null)
                {
                    _isShowClientInfo = (bool)ViewState["IsShowClientInfo"];
                }
                if (ViewState["Menu"] != null)
                {
                    _menu = ViewState["Menu"].ToString();
                }
                if (ViewState["multiLocationList"] != null)
                {
                    _multiLocationList = ViewState["multiLocationList"].ToString();
                }
                if (ViewState["leaseStatus"] != null)
                {
                    _leaseStatus = ViewState["leaseStatus"].ToString();
                }
                if (ViewState["tenureType"] != null)
                {
                    _tenureType = ViewState["tenureType"].ToString();
                }
                if (ViewState["showSearchPane"] != null)
                {
                    _showSearchPane = (bool)ViewState["showSearchPane"];
                }
                if (ViewState["fromCond"] != null)
                {
                    _fromCond = ViewState["fromCond"].ToString();
                }
                initForm();
            }
            else {
                //if (Request.QueryString["RecordId"] != null) {
                //    _recordId = long.Parse(Request.QueryString["RecordId"].ToString());
                //    ViewState["RecordId"] = _recordId;
                //}
      
                if (Request.QueryString["MySearchId"] != null)
                {
                    _mySearchId = long.Parse(Request.QueryString["MySearchId"].ToString());
                    ViewState["MySearchId"] = _mySearchId;
                }
      
                if (Request.QueryString["ClientId"] != null)
                {
                    _clientId= long.Parse(Request.QueryString["ClientId"].ToString());
                    ViewState["ClientId"] = _clientId;
                }
                if (Request.QueryString["AssoClientId"] != null)
                {
                    _assoClientId = long.Parse(Request.QueryString["AssoClientId"].ToString());
                    ViewState["AssoClientId"] = _assoClientId;
                }
                if (Request.QueryString["Action"] != null)
                {
                    _action = Request.QueryString["Action"].ToString();
                    ViewState["Action"] = _action;
                }
                if (Request.QueryString["IsCreateNewMySearch"] != null)
                {
                    _isCreateNewMySearch = (Request.QueryString["IsCreateNewMySearch"].ToString() == "1");
                    ViewState["IsCreateNewMySearch"] = _isCreateNewMySearch;
                }
                if (Request.QueryString["Menu"] != null)
                {
                    _menu = Request.QueryString["Menu"].ToString();
                    ViewState["Menu"] = _menu;
                }
                if (Request.QueryString["multiLocationList"] != null)
                {
                    _multiLocationList = Request.QueryString["multiLocationList"].ToString();
                    ViewState["multiLocationList"] = _multiLocationList;
                }
                if (Request.QueryString["leaseStatus"] != null)
                {
                    _leaseStatus = Request.QueryString["leaseStatus"].ToString();
                    ViewState["leaseStatus"] = _leaseStatus;
                }
                if (Request.QueryString["tenureType"] != null)
                {
                    _tenureType = Request.QueryString["tenureType"].ToString();
                    ViewState["tenureType"] = _tenureType;
                }
                if (Request.QueryString["showSearchPane"] != null)
                {
                    _showSearchPane = (Request.QueryString["showSearchPane"].ToString() == "1");
                    ViewState["showSearchPane"] = _showSearchPane;
                }
                if (Request.QueryString["fromCond"] != null)
                {
                    _fromCond = Request.QueryString["fromCond"].ToString();
                    ViewState["fromCond"] = _fromCond;
                }
                initForm();
                loadData();
            }
        }
        #endregion
      
        #region page functions
      
        private void initForm() {
            checkAccessRight();
            //RadComboBox cbo = new RadComboBox();
            //spbLeft.FindItemByValue("Prospect").Items[0].Controls.Add(cbo);
            Control_SearchControl_ProspectSearchCtl prospectSearchCtl = Page.LoadControl("~/Control/SearchControl/ProspectSearchCtl.ascx") as Control_SearchControl_ProspectSearchCtl;
            prospectSearchCtl.ID = "prospectSearchCtl";
            spbLeft.FindItemByValue("Prospect").Items[0].Controls.Add(prospectSearchCtl);
                    //if (_showSearchPane)
                    //{
                    //    spbLeft.FindItemByValue("Transaction").Visible = true;
                    //    Control_TransactionSearchCtl TransactionSearchCtl = Page.LoadControl("~/Control/TransactionSearchCtl.ascx") as Control_TransactionSearchCtl;
                    //    TransactionSearchCtl.ID = "TransactionSearchCtl";
                    //    TransactionSearchCtl.employeeId = long.Parse(this.employeeId);
                    //    TransactionSearchCtl.langDB = base.langDB;
                    //    spbLeft.FindItemByValue("Transaction").Controls.Add(TransactionSearchCtl);
                    //    spbLeft.FindItemByValue("Transaction").Selected = true;
                    //}
                    //else
                    //{
                    //    sptMainFrame.GetPaneById("splLeft").Visible = false;
                    //}
                    //Control_TransactionSearchResultCtl TransactionSearchResultCtl = Page.LoadControl("~/Control/TransactionSearchResultCtl.ascx") as Control_TransactionSearchResultCtl;
                    //TransactionSearchResultCtl.ID = "TransactionSearchResultCtl";
                    //TransactionSearchResultCtl.employeeId = long.Parse(this.employeeId);
                    //TransactionSearchResultCtl.unitId = -1;
                    //TransactionSearchResultCtl.multiLocationList = _multiLocationList;
                    //TransactionSearchResultCtl.tenureType = _tenureType;
                    //TransactionSearchResultCtl.leaseStatus = _leaseStatus;
                    //TransactionSearchResultCtl.langDB = base.langDB;
                    //TransactionSearchResultCtl.fromCond = _fromCond;
                    //pvwTransaction.Controls.Add(TransactionSearchResultCtl);
                    
      
                    //sptMainFrame.GetPaneById("splLeft").Visible = false;
                    //spbLeft.FindItemByValue("Prospect").Visible = false;
                    //spbLeft.FindItemByValue("Prospect").Selected = false;
                      
                    //Control_ClientRegCtl ClientRegCtl = Page.LoadControl("~/Control/ClientRegCtl.ascx") as Control_ClientRegCtl;
                    //ClientRegCtl.employeeId = long.Parse(this.employeeId);
                    //ClientRegCtl.clientId = _clientId;
                    //ClientRegCtl.assoClientId = _assoClientId;
                    //ClientRegCtl.mySearchId = _mySearchId;
                    //ClientRegCtl.langDB = base.langDB;
                    //ClientRegCtl.action = _action;
                    //ClientRegCtl.isShowClientInfo = _isShowClientInfo;
                    //ClientRegCtl.isCreateNewMySearch = _isCreateNewMySearch;
                    //ClientRegCtl.systemName = base.systemName;
                    //pvwProspect.Controls.Add(ClientRegCtl);
                     
        }
      
        private void loadData()
        {
              
             
        }
      
      
      
      
        private void checkAccessRight()
        {
            if (CommonFunction.IsSystemParameterExist("BOAccess", "Home", this.employeeId))
            {
            }
            else
            {
            }
      
            if (CommonFunction.IsSystemParameterExist("BOAccess", "Report", this.employeeId))
            {
                spbLeft.FindItemByValue("Report").Visible = true;
                spbLeft.FindItemByValue("Report").Selected = true;
                spbLeft.FindItemByValue("Report").Expanded = true;
            }
            else
            {
                spbLeft.FindItemByValue("Report").Visible = false;
            }
      
            if (CommonFunction.IsSystemParameterExist("BOAccess", "Transaction", this.employeeId))
            {
                spbLeft.FindItemByValue("Transaction").Visible = true;
                spbLeft.FindItemByValue("Transaction").Selected = true;
                spbLeft.FindItemByValue("Transaction").Expanded = true;
            }
            else
            {
                spbLeft.FindItemByValue("Transaction").Visible = false;
            }
      
            if (CommonFunction.IsSystemParameterExist("BOAccess", "Building", this.employeeId))
            {
                spbLeft.FindItemByValue("Building").Visible = true;
                spbLeft.FindItemByValue("Building").Selected = true;
                spbLeft.FindItemByValue("Building").Expanded = true;
            }
            else
            {
                spbLeft.FindItemByValue("Building").Visible = false;
            }
      
            if (CommonFunction.IsSystemParameterExist("BOAccess", "Invoice", this.employeeId))
            {
                spbLeft.FindItemByValue("Invoice").Visible = true;
                spbLeft.FindItemByValue("Invoice").Selected = true;
                spbLeft.FindItemByValue("Invoice").Expanded = true;
            }
            else
            {
                spbLeft.FindItemByValue("Invoice").Visible = false;
            }
      
            if (CommonFunction.IsSystemParameterExist("BOAccess", "Client", this.employeeId))
            {
                spbLeft.FindItemByValue("Client").Visible = true;
                spbLeft.FindItemByValue("Client").Selected = true;
                spbLeft.FindItemByValue("Client").Expanded = true;
            }
            else
            {
                spbLeft.FindItemByValue("Client").Visible = false;
            }
      
      
            if (CommonFunction.IsSystemParameterExist("BOAccess", "Prospect", this.employeeId))
            {
                spbLeft.FindItemByValue("Prospect").Visible = true;
                spbLeft.FindItemByValue("Prospect").Selected = true;
                spbLeft.FindItemByValue("Prospect").Expanded = true;
            }
            else
            {
                spbLeft.FindItemByValue("Prospect").Visible = false;
            }
      
            if (CommonFunction.IsSystemParameterExist("BOAccess", "Stock", this.employeeId))
            {
                spbLeft.FindItemByValue("Stock").Visible = true;
                spbLeft.FindItemByValue("Stock").Selected = true;
                spbLeft.FindItemByValue("Stock").Expanded = true;
            }
            else
            {
                spbLeft.FindItemByValue("Stock").Visible = false;
            }
        }
        #endregion
    }





  2. Cloud
    Cloud avatar
    24 posts
    Member since:
    Oct 2008

    Posted 16 Jul 2012 Link to this post

    anyone have idea for custom user control and panel bar?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 19 Jul 2012 Link to this post

    Hi Cloud,

    Using your code, I was not able to replicate the issue - http://screencast.com/t/RYTQRJPfZxe. Can you isolate the problem in a sample and send it to us via a support ticket. This way we will be able to debug it locally and probably suggest a workaround.


    All the best, Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top