Very slow performance expand the panel bar

7 posts, 0 answers
  1. CH
    CH avatar
    28 posts
    Member since:
    Nov 2008

    Posted 06 Sep 2010 Link to this post

    Dear expert:
       I have a webpage with panelbar inside the splitter. there is a  problem when i used the template. if i add more control to the panel bar template then the time need to expand the panelbar will take a long time.. e.g. 10 sec.
    is there anything i get wrong or any solution to make the panelbar expand with normal speed?
    i don't think it is the problem of code behide.... but it seem the problem of the client script case of the slow performance.

    i hope it can solve within the week.. because the project have to demo this week, thks!!1

    From CH...
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Main.aspx.cs" Inherits="STEPS_Pages_CommonPages_Main" %>
      
    <!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>STEPS</title>
        <link href="~/css/common2.css" type="text/css" rel="stylesheet"/>    
        <style type="text/css">  
        html, body, form  
        {  
            height: 100%;  
            margin: 0px;  
            padding: 0px;  
            overflow: hidden;  
        }  
        </style>  
      
    </head>
    <script type="text/javascript" language="javascript">
            function mnuClientNew_onClientClick(sender, eventArgs){
                var itemValue = eventArgs.get_item().get_value();
                if (itemValue == "Contact"){
                  
                }else if (itemValue == "Company"){
                  
                }else if (itemValue == "Brand"){
                  
                }else if (itemValue == "Agent"){
                  
                }
      
            }
      
            function Resize(){
                var frameClient = document.getElementById("frameClient");
                frameClient.style.height = screen.availHeight -180;
            }
              
            function cboClientName_OnClientItemsRequesting(sender, eventArgs){
               if (eventArgs.get_text().length < 3)
                 eventArgs.set_cancel(true)
               else{
                 eventArgs.set_cancel(false);
                 var barMenuLeft = $find("<%= barMenuLeft.ClientID %>");
                 var clientItem  = barMenuLeft.findItemByValue("Client");
                 var clientExpressItem  = barMenuLeft.findItemByValue("Client_Express");
                 var clientExpressSearchItem  = barMenuLeft.findItemByValue("Client_Express_Search");
                 var rdoAll = $telerik.findElement(clientExpressSearchItem.get_element(), "rdoAll");
                 var rdoContact = $telerik.findElement(clientExpressSearchItem.get_element(), "rdoContact");    
                 var rdoCompany = $telerik.findElement(clientExpressSearchItem.get_element(), "rdoCompany"); 
                 var rdoBrand = $telerik.findElement(clientExpressSearchItem.get_element(), "rdoBrand");
                 var rdoAgency =  $telerik.findElement(clientExpressSearchItem.get_element(), "rdoAgency");
                   
                 var txtPhone = $telerik.findElement(clientExpressSearchItem.get_element(), "txtPhone"); 
                 var txtVehicleNumber = $telerik.findElement(clientExpressSearchItem.get_element(), "txtVehicleNumber");    
                 var txtEmail = $telerik.findElement(clientExpressSearchItem.get_element(), "txtEmail");
                 var dpBirthdayFr = clientExpressSearchItem.findControl("dpBirthdayFr");
                 var dpBirthdayTo = clientExpressSearchItem.findControl("dpBirthdayTo");
                 var chkShowAllAsso = $telerik.findElement(clientExpressSearchItem.get_element(), "chkShowAllAsso");    
                   
                 var context = eventArgs.get_context();
                 if (rdoAll.checked){
                    context["ClientType"] = "All";
                 }else if (rdoContact.checked){
                    context["ClientType"] = "Contact";
                 }else if (rdoCompany.checked){
                    context["ClientType"] = "Company";
                 }else if (rdoBrand.checked){
                    context["ClientType"] = "Brand";
                 }else if (rdoAgency.checked){
                    context["ClientType"] = "Agency";
                 }
                   
    //             if (txtPhone.value != ""){
    //                context["Phone"] = txtPhone.value;
    //             }
    //             
    //             if (txtVehicleNumber.value != ""){
    //                context["VehicleNumber"] = txtVehicleNumber.value;
    //             }
    //             
    //             if (txtEmail.value != ""){
    //                context["Email"] = txtEmail.value;
    //             }
    //             
    //             if (!dpBirthdayFr.isEmpty()){
    //                context["BirthdayFr"] = dpBirthdayFr.get_selectedDate();
    //             }
    //             
    //             if (!dpBirthdayTo.isEmpty()){
    //                context["BirthdayTo"] = dpBirthdayTo.get_selectedDate();
    //             }
                   
                 if (chkShowAllAsso.checked){
                    context["IsShowAllAsso"] = "1";
                 }
                   
               }
            }
              
            function toggle(link, divId) { 
                var lText = link.innerHTML; 
                  
                var d = document.getElementById(divId);
                if (lText == '+') { 
                    link.innerHTML = '−'; 
                    d.style.display = 'block'; 
                }else{ 
                    link.innerHTML = '+'; 
                    d.style.display = 'none'; 
                
                  
            }
              
            function cboClientName_keyPressHandler (sender, args){
              
                if (args.get_domEvent().keyCode == 13)
                {
                      
                    var barMenuLeft = $find("<%= barMenuLeft.ClientID %>");
                     var clientItem  = barMenuLeft.findItemByValue("Client");
                     var clientExpressItem  = barMenuLeft.findItemByValue("Client_Express");
                     var clientExpressSearchItem  = barMenuLeft.findItemByValue("Client_Express_Search");
                   
                    var searchBtn = $telerik.findElement(clientExpressSearchItem.get_element(), "btnClientSearch"); 
                    if (searchBtn)
                    {   
                        searchBtn.click();
                    }
                }
            }
              
              
            function showHideStkSearch(){
                var barMenuLeft = $find("<%= barMenuLeft.ClientID %>");
                var stockItem  = barMenuLeft.findItemByValue("Stock");
                var stockExpressItem  = barMenuLeft.findItemByValue("Stock_Express");
                var stockExpressSearchItem  = barMenuLeft.findItemByValue("Stock_Express_Search");
                var refStkAdvanced = $telerik.findElement(stockExpressSearchItem.get_element(), "refStkAdvanced");
                var trStkFloorArea = $telerik.findElement(stockExpressSearchItem.get_element(), "trStkFloorArea");
                var trStkActive = $telerik.findElement(stockExpressSearchItem.get_element(), "trStkActive");
                var trStkPrice = $telerik.findElement(stockExpressSearchItem.get_element(), "trStkPrice");
                var trStkFunction = $telerik.findElement(stockExpressSearchItem.get_element(), "trStkFunction");
                var trStkLastEdit = $telerik.findElement(stockExpressSearchItem.get_element(), "trStkLastEdit");
                var trStkCommerce = $telerik.findElement(stockExpressSearchItem.get_element(), "trStkCommerce");
                var trStkExpiry = $telerik.findElement(stockExpressSearchItem.get_element(), "trStkExpiry");
                  
                if (refStkAdvanced.innerHTML == "Advanced"){
                    refStkAdvanced.innerHTML = "Simple";
                    trStkFloorArea.style.display = "inline";
                    trStkActive.style.display = "inline";
                    trStkPrice.style.display = "inline";
                    trStkFunction.style.display = "inline";
                    trStkLastEdit.style.display = "inline";
                    trStkCommerce.style.display = "inline";
                    trStkExpiry.style.display = "inline";
                    ResizePane(120, "<%= RadSplitter1.ClientID %>", "<%= pnlLeft.ClientID %>");
                }else{
                    refStkAdvanced.innerHTML = "Advanced";
                    trStkFloorArea.style.display = "none";
                    trStkActive.style.display = "none";
                    trStkPrice.style.display = "none";
                    trStkFunction.style.display = "none";
                    trStkLastEdit.style.display = "none";
                    trStkCommerce.style.display = "none";
                    trStkExpiry.style.display = "none";
                    ResizePane(-120, "<%= RadSplitter1.ClientID %>", "<%= pnlLeft.ClientID %>");
                }
            }
              
            function ResizePane(size, splitterID,  paneID){
                var splitter = $find(splitterID);
                var pane = splitter.getPaneById(paneID);
                if (!pane) return;
                pane.resize(size);
            }
      
              
        </script>
    <body onload="Resize();" >
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
                    <div id="ParentDivElement" style="height: 100%;"
                        <telerik:RadSplitter ID="RadSplitter1" runat="server" Skin="Office2007" SplitBarsSize="" Width="100%" Height="100%">
                            <telerik:RadPane ID="pnlLeft" runat="server" Width="250px" Scrolling="Y">
                                <telerik:RadPanelBar ID="barMenuLeft" runat="server" Skin="Office2007" Width="98%" >
                                    <Items>
                                        <telerik:RadPanelItem runat="server" Text="Client" Value="Client" ImageUrl="~/images/User-icon.png">
                                            <Items>
                                                <telerik:RadPanelItem runat="server"  >
                                                    <ItemTemplate>
                                                        <telerik:RadMenu ID="mnuClientNew" runat="server" Flow="Vertical" Width="100%" OnItemClick="mnuClientNew_ItemClick" Skin="Telerik">
                                                            <Items>
                                                                <telerik:RadMenuItem Text="New" Width="100%" runat="server">
                                                                    <Items>
                                                                        <telerik:RadMenuItem Text="Contact" Value="Contact" runat="server"  />
                                                                        <telerik:RadMenuItem Text="Company" Value="Company" runat="server" />
                                                                        <telerik:RadMenuItem Text="Brand" Value="Brand" runat="server" />
                                                                        <telerik:RadMenuItem Text="Agent" Value="Agent" runat="server" />
                                                                    </Items>
                                                                </telerik:RadMenuItem>
                                                            </Items>
                                                        </telerik:RadMenu>
      
                                                    </ItemTemplate>
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Text="Express Search" Value="Client_Express">
                                                    <Items>
                                                        <telerik:RadPanelItem runat="server" Value="Client_Express_Search" >
                                                            <ItemTemplate>
                                                                <table>
                                                                    <tr height="30">
                                                                        <td>
                                                                            <telerik:RadComboBox ID="cboClientName" runat="server" AllowCustomText="True" OnClientKeyPressing="cboClientName_keyPressHandler"
                                                                                OnItemsRequested="cboClientName_ItemsRequested" EnableLoadOnDemand="True" Width="160px" Skin="Office2007" ExpandDelay="400" OnClientItemsRequesting="cboClientName_OnClientItemsRequesting">
                                                                            </telerik:RadComboBox
                                                                            <asp:ImageButton ID="btnClientSearch" runat="server" ImageUrl="~/images/search.png" OnClick="btnClientSearch_Click" /> [<a title="Advance Search" id="refAdvSearch" href="javascript: void(0);" onclick="toggle(this, 'gpClientAdvSearch');">+</a>]
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            <div id="gpClientAdvSearch" style="display:none">
                                                                                <fieldset>
                                                                                    <legend>Advance search criteria</legend>
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td>Name:</td>
                                                                                            <td>
                                                                                                <table width="100%">
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoStartWith" runat="server" Text="Start With" GroupName="ClientName" Checked="true" />
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoContain" runat="server" Text="Contain"  GroupName="ClientName" />
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td colspan="2">
                                                                                                <hr />
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td valign="top">
                                                                                                Type:
                                                                                            </td>
                                                                                            <td>
                                                                                                <table width="100%">
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoAll" Text="All" runat="server" Checked="true"  GroupName="clientType"  />
                                                                                                        </td>
                                                                                                        <td>
                                                                                                              
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoCompany" Text="Company" runat="server" GroupName="clientType" />
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoContact" Text="Contact" runat="server" />
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoBrand" Text="Brand" runat="server" />
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoAgency" Text="Agency" runat="server" />
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>Phone:</td>
                                                                                            <td>
                                                                                                <asp:TextBox ID="txtPhone" runat="server" Width="140px"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>Vehicle:</td>
                                                                                            <td>
                                                                                                <asp:TextBox ID="txtVehicleNumber" runat="server" Width="140px"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>Email:</td>
                                                                                            <td>
                                                                                                <asp:TextBox ID="txtEmail" runat="server" Width="140px"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>Birth Fr:</td>
                                                                                            <td>
                                                                                                <telerik:RadDatePicker ID="dpBirthdayFr" runat="server" Skin="Office2007" Width="140px">
                                                                                                    <Calendar Skin="Office2007" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                                                                                        ViewSelectorText="x">
                                                                                                    </Calendar>
                                                                                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                                                                    <DateInput DateFormat="dd-MM-yyyy" DisplayDateFormat="dd-MM-yyyy">
                                                                                                    </DateInput>
                                                                                                </telerik:RadDatePicker>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>Birth To:</td>
                                                                                            <td>
                                                                                                <telerik:RadDatePicker ID="dpBirthdayTo" runat="server" Skin="Office2007" Width="140px">
                                                                                                    <Calendar Skin="Office2007" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"
                                                                                                        ViewSelectorText="x">
                                                                                                    </Calendar>
                                                                                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                                                                    <DateInput DateFormat="dd-MM-yyyy" DisplayDateFormat="dd-MM-yyyy">
                                                                                                    </DateInput>
                                                                                                </telerik:RadDatePicker>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>All:</td>
                                                                                            <td>
                                                                                                <asp:CheckBox id="chkShowAllAsso" runat="server"></asp:CheckBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </fieldset>
                                                                            </div>  
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                            </ItemTemplate>
                                                        </telerik:RadPanelItem>
                                                    </Items>
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Text="My Favourite" Value="Client_Favourite">
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Text="My Access History" Value="Client_History">
                                                </telerik:RadPanelItem>
                                            </Items>
                                        </telerik:RadPanelItem>
                                        <telerik:RadPanelItem runat="server" Text="Stock" Value="Stock" ImageUrl="~/images/Property-icon.png">
                                            <Items>
                                                <telerik:RadPanelItem runat="server" Text="Express Search" Value="Stock_Express">
                                                    <Items>
                                                        <telerik:RadPanelItem runat="server" Value="Stock_Express_Search" >
                                                            <ItemTemplate>
                                                                <table>
                                                                    <tr>
                                                                        <td >
                                                                            <telerik:RadTabStrip ID="tabStk" runat="server" SelectedIndex="0" Skin="Office2007" MultiPageID="mpgStk">
                                                                                <Tabs>
                                                                                    <telerik:RadTab runat="server" Selected="True" SelectedIndex="0" Text="Info" Value="Info">
                                                                                    </telerik:RadTab>
                                                                                    <telerik:RadTab runat="server" SelectedIndex="1" Text="Preset" Value="Preset">
                                                                                    </telerik:RadTab>
                                                                                    <telerik:RadTab runat="server" SelectedIndex="2" Text="Map" Value="Map">
                                                                                    </telerik:RadTab>
                                                                                </Tabs>
                                                                            </telerik:RadTabStrip>
                                                                            <telerik:RadMultiPage ID="mpgStk" runat="server">
                                                                                <telerik:RadPageView ID="pvwStkInfo" runat="server" Selected="True">
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td>Location</td>
                                                                                            <td>
                                                                                                <telerik:RadComboBox ID="cboStkLocation" runat="server" Width="150px" AllowCustomText="True" EnableLoadOnDemand="True" OnItemsRequested="cboStkLocation_ItemsRequested">
                                                                                                </telerik:RadComboBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>Street No.</td>
                                                                                            <td>
                                                                                                <telerik:RadNumericTextBox ID="txtStkStreetFr" runat="server" Width="30px" Skin="Office2007">
                                                                                                </telerik:RadNumericTextBox>
                                                                                                -
                                                                                                <telerik:RadNumericTextBox ID="txtStkStreetTo" runat="server" Width="30px" Skin="Office2007">
                                                                                                </telerik:RadNumericTextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>Owner</td>
                                                                                            <td>
                                                                                                <telerik:RadComboBox ID="cboStkOwner" runat="server" Width="150px" AllowCustomText="True" EnableLoadOnDemand="True">
                                                                                                </telerik:RadComboBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr id="trStkFloorArea"  style="display:none">
                                                                                            <td>Floor Area</td>
                                                                                            <td>
                                                                                                <telerik:RadSlider ID="sldStkFloorArea" runat="server" Skin="Office2007">
                                                                                                </telerik:RadSlider>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr id="trStkActive" style="display:none">
                                                                                            <td>Active Only</td>
                                                                                            <td>
                                                                                                <table>
                                                                                                    <tr>
                                                                                                        <td>
                                                                                                            <asp:CheckBox ID="chkStkActive" runat="server" /> </td>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoStkLet" runat="server" Text="Let" Checked="True" ValidationGroup="MarketType" />
                                                                                                        </td>
                                                                                                        <td>
                                                                                                            <asp:RadioButton ID="rdoStkSale" runat="server" Text="Sale" ValidationGroup="MarketType" />
                                                                                                        </td>
                                                                                                        <td>
                                                                                                             Last Edit</td>
                                                                                                        <td>
                                                                                                            <telerik:RadComboBox ID="rboStkLastEdit" runat="server" Skin="Office2007" AllowCustomText="True" EnableLoadOnDemand="True">
                                                                                                            </telerik:RadComboBox>
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                </table>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr id="trStkPrice" style="display:none">
                                                                                            <td>Price</td>
                                                                                            <td>
                                                                                                <telerik:RadSlider ID="sldStkPrice" runat="server" Skin="Office2007">
                                                                                                </telerik:RadSlider>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr id="trStkFunction" style="display:none">
                                                                                            <td>Function</td>
                                                                                            <td>
                                                                                                <asp:CheckBox ID="chkStockRES" runat="server" Text="RES" />
                                                                                                <asp:CheckBox ID="chkStockRET" runat="server" Text="RET" />
                                                                                                <asp:CheckBox ID="chkStockCOM" runat="server" Text="COM" />
                                                                                                <asp:CheckBox ID="chkStockIDU" runat="server" Text="IDU" />
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr id="trStkLastEdit" style="display:none">
                                                                                            <td>Last Edit</td>
                                                                                            <td>
                                                                                                <telerik:RadDatePicker ID="dtpLastEdit" runat="server">
                                                                                                    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                                                                                                    </Calendar>
                                                                                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                                                                    <DateInput DateFormat="dd-MM-yyyy" DisplayDateFormat="dd-MM-yyyy">
                                                                                                    </DateInput>
                                                                                                </telerik:RadDatePicker>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr id="trStkCommerce" style="display:none">
                                                                                            <td>Commerce Date</td>
                                                                                            <td>
                                                                                                <telerik:RadDatePicker ID="dtpCommerceFr" runat="server">
                                                                                                    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                                                                                                    </Calendar>
                                                                                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                                                                    <DateInput DateFormat="dd-MM-yyyy" DisplayDateFormat="dd-MM-yyyy">
                                                                                                    </DateInput>
                                                                                                </telerik:RadDatePicker>
                                                                                                -
                                                                                                <telerik:RadDatePicker ID="dtpCommerceTo" runat="server">
                                                                                                    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                                                                                                    </Calendar>
                                                                                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                                                                    <DateInput DateFormat="dd-MM-yyyy" DisplayDateFormat="dd-MM-yyyy">
                                                                                                    </DateInput>
                                                                                                </telerik:RadDatePicker>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr id="trStkExpiry"  style="display:none">
                                                                                            <td>Expiry Date</td>
                                                                                            <td>
                                                                                                <telerik:RadDatePicker ID="dtpExpiryFr" runat="server">
                                                                                                    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                                                                                                    </Calendar>
                                                                                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                                                                    <DateInput DateFormat="dd-MM-yyyy" DisplayDateFormat="dd-MM-yyyy">
                                                                                                    </DateInput>
                                                                                                </telerik:RadDatePicker>
                                                                                                -
                                                                                                <telerik:RadDatePicker ID="dtpExpiryTo" runat="server">
                                                                                                    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                                                                                                    </Calendar>
                                                                                                    <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                                                                                    <DateInput DateFormat="dd-MM-yyyy" DisplayDateFormat="dd-MM-yyyy">
                                                                                                    </DateInput>
                                                                                                </telerik:RadDatePicker>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <a id="refStkAdvanced" onclick="showHideStkSearch();" href="javascript:void(0);">Advanced</a>
                                                                                            </td>
                                                                                            <td align="right">
                                                                                                <asp:Button ID="btnStkReset" runat="server" Text="Reset" />
                                                                                                <asp:Button ID="btnStkSearch" runat="server" Text="Search" OnClick="btnStkSearch_Click" />
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </telerik:RadPageView>
                                                                                <telerik:RadPageView ID="pvwStkPreset" runat="server">
                                                                                </telerik:RadPageView>
                                                                                <telerik:RadPageView ID="pvwStkMap" runat="server">
                                                                                </telerik:RadPageView>
                                                                            </telerik:RadMultiPage></td>
                                                                    </tr>
                                                                </table>
                                                                  
                                                            </ItemTemplate
                                                        </telerik:RadPanelItem>
                                                    </Items>
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Text="My Favourite" Value="Stock_Favourite">
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Text="My Access History" Value="Stock_History">
                                                </telerik:RadPanelItem>
                                            </Items>
                                        </telerik:RadPanelItem>
                                        <telerik:RadPanelItem runat="server" Text="Invoice">
                                        </telerik:RadPanelItem>
                                    </Items>
                                    <CollapseAnimation Type="None" Duration="0" />
                                    <ExpandAnimation Type="None"  Duration="0" />
                                </telerik:RadPanelBar>
                            </telerik:RadPane>
                            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward">
                            </telerik:RadSplitBar>
                            <telerik:RadPane ID="pnlMain" runat="server">
                                <table width="100%">
                                    <tr>
                                        <td >
                                            <telerik:RadTabStrip ID="tabMenuTop" runat="server" SelectedIndex="0" Skin="Office2007" MultiPageID="RadMultiPage1">
                                                <Tabs>
                                                    <telerik:RadTab runat="server" Selected="True" SelectedIndex="0" Text="Client">
                                                    </telerik:RadTab>
                                                    <telerik:RadTab runat="server" SelectedIndex="1" Text="Stock">
                                                    </telerik:RadTab>
                                                    <telerik:RadTab runat="server" SelectedIndex="2" Text="invoice">
                                                    </telerik:RadTab>
                                                </Tabs>
                                            </telerik:RadTabStrip>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td >
                                            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" ScrollBars="None" SelectedIndex="0"
                                                Width="100%">
                                                <telerik:RadPageView ID="pvwClient" runat="server">
                                                    <iframe id="frameClient" runat="server"  width="100%" >
                                                    </iframe>
                                                </telerik:RadPageView>
                                                <telerik:RadPageView ID="pvwStock" runat="server" TabIndex="1" Width="100%">
                                                    <iframe id="frameStock" runat="server"  width="100%" src="SearchResult/Search_Instruction.aspx" >
                                                    </iframe>
                                                </telerik:RadPageView>
                                                <telerik:RadPageView ID="pvwInvoice" runat="server" TabIndex="2" Width="100%">
                                                    <iframe id="frameInvoice" runat="server"  width="100%"  >
                                                    </iframe>
                                                </telerik:RadPageView>
                                            </telerik:RadMultiPage>
                                        </td>
                                    </tr>
                                </table>
                            </telerik:RadPane>
                        </telerik:RadSplitter>
                        </div>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnClientSearch">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="frameClient" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="mnuClientNew">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="frameClient" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
                <ClientEvents OnResponseEnd="Resize" />
            </telerik:RadAjaxManager>
        </form>
    </body>
    </html>
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Telerik.Web.UI;
    using Savills.DataSource;
      
    public partial class STEPS_Pages_CommonPages_Main : System.Web.UI.Page
    {
        private DataSet _employeeDS;
        private string _employeeId;
      
        protected string employeeId
        {
            get{
                return _employeeId;
            }
            set {
                _employeeId = value;
            }
        }
      
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack ){
                if (ViewState["EmployeeDS"] != null) {
                    _employeeDS = (DataSet)ViewState["EmployeeDS"];
                }
                if (ViewState["Employee_Id"] != null) {
                    _employeeId = ViewState["Employee_Id"].ToString();
                }
            }else{
                string loginName = User.Identity.Name.Substring(User.Identity.Name.IndexOf(@"\")+1 );
                STEPS_Employee_DataAdapter employeeDA = new STEPS_Employee_DataAdapter();
                _employeeDS  =employeeDA.GetEmployeeDetailByLoginName(loginName);
                ViewState["EmployeeDS"] = _employeeDS;
                if (_employeeDS.Tables[0].Rows.Count >0 ){
                    _employeeId = _employeeDS.Tables[0].Rows[0]["Employee_Id_Text"].ToString();
                    ViewState["Employee_Id"] = _employeeId;
                }else{
                    throw new Exception("Login cannot found");
                }
                initForm();
            }
        }
      
        private void initForm() {
            if (_employeeDS.Tables[0].Rows.Count > 0)
            {
                if (_employeeDS.Tables[0].Rows[0]["Default_CS_Search_All"] != DBNull.Value) {
                    if (_employeeDS.Tables[0].Rows[0]["Default_CS_Search_All"].ToString().ToUpper() == "TRUE") {
                        RadPanelItem clientItem = barMenuLeft.Items.FindItemByValue("Client");
                        RadPanelItem clientExpressItem = clientItem.Items.FindItemByValue("Client_Express");
                        RadPanelItem clientExpressSearchItem = clientExpressItem.Items.FindItemByValue("Client_Express_Search");
                        CheckBox chkShowAllAsso = (CheckBox)clientExpressSearchItem.FindControl("chkShowAllAsso");
                        chkShowAllAsso.Checked = true
                    }
                }
            }
        }
      
      
      
      
        protected void btnClientSearch_Click(object sender, ImageClickEventArgs e)
        {
            RadPanelItem clientItem = barMenuLeft.Items.FindItemByValue("Client");
            RadPanelItem clientExpressItem = clientItem.Items.FindItemByValue("Client_Express");
            RadPanelItem clientExpressSearchItem = clientExpressItem.Items.FindItemByValue("Client_Express_Search");
            RadComboBox cboClientName = (RadComboBox)clientExpressSearchItem.FindControl("cboClientName");
            RadioButton rdoStartWith = (RadioButton)clientExpressSearchItem.FindControl("rdoStartWith");
            RadioButton rdoContain = (RadioButton)clientExpressSearchItem.FindControl("rdoContain");
            RadioButton rdoAll = (RadioButton)clientExpressSearchItem.FindControl("rdoAll");
            RadioButton rdoCompany = (RadioButton)clientExpressSearchItem.FindControl("rdoCompany");
            RadioButton rdoContact = (RadioButton)clientExpressSearchItem.FindControl("rdoContact");
            RadioButton rdoBrand = (RadioButton)clientExpressSearchItem.FindControl("rdoBrand");
            RadioButton rdoAgency = (RadioButton)clientExpressSearchItem.FindControl("rdoAgency");
            TextBox txtPhone = (TextBox)clientExpressSearchItem.FindControl("txtPhone");
            TextBox txtVehicleNumber = (TextBox)clientExpressSearchItem.FindControl("txtVehicleNumber");
            TextBox txtEmail = (TextBox)clientExpressSearchItem.FindControl("txtEmail");
            RadDatePicker dpBirthdayFr = (RadDatePicker)clientExpressSearchItem.FindControl("dpBirthdayFr");
            RadDatePicker dpBirthdayTo = (RadDatePicker)clientExpressSearchItem.FindControl("dpBirthdayTo");
            CheckBox chkShowAllAsso = (CheckBox)clientExpressSearchItem.FindControl("chkShowAllAsso");
      
            string clientName = null;
            string startWith = null;
            string clientType = null;
            string clientSubType = null;
            string phone = null;
            string vehicleNumber = null;
            string email = null;
            string birthdayFr = null;
            string birthdayTo = null;
            string isShowAllAsso = null;
      
            clientName = "&ClientName=" + cboClientName.Text;
      
            if (rdoStartWith.Checked)
            {
                startWith = "&StartWith=1";
            }
            else {
                startWith = "&StartWith=0";
            }
      
            if (rdoAll.Checked) {
      
            }
            else if (rdoCompany.Checked) {
                clientType = "&ClientType=Company";
                clientSubType = "&ClientSubType=Company";
            }
            else if (rdoContact.Checked) {
                clientType = "&ClientType=Contact";
                clientSubType = "";
            }
            else if (rdoBrand.Checked) {
                clientType = "&ClientType=Company";
                clientSubType = "&ClientSubType=Brand";
            }
            else if (rdoAgency.Checked) {
                clientType = "&ClientType=Company";
                clientSubType = "&ClientSubType=Agent";
            }
      
            if (txtPhone.Text.Trim() != "") {
                phone = "&Phone=" + txtPhone.Text.Trim();
            }
      
            if (txtVehicleNumber.Text.Trim() != "") {
                vehicleNumber = "&VehicleNumber=" + txtVehicleNumber.Text.Trim();
            }
      
            if (txtEmail.Text.Trim() != "") {
                email = "&Email=" + txtEmail.Text.Trim();
            }
      
            if (dpBirthdayFr.SelectedDate.HasValue )
            {
                birthdayFr = "&BirthdayFr=" + ((DateTime)dpBirthdayFr.SelectedDate).ToString("yyyy/MM/dd");
            }
      
            if (dpBirthdayTo.SelectedDate.HasValue)
            {
                birthdayTo = "&BirthdayTo=" + ((DateTime)dpBirthdayTo.SelectedDate).ToString("yyyy/MM/dd");
            }
      
            if (chkShowAllAsso.Checked) {
                isShowAllAsso = "&IsShowAllAsso=1";
            } else {
                isShowAllAsso = "&IsShowAllAsso=0";
            }
            frameClient.Attributes["src"] = "./Main_Detail_Panel.aspx?AccessForm=Client&Action=Client_Search&EmployeeId=" + _employeeId + clientName + startWith + clientType + clientSubType + phone + vehicleNumber + email + birthdayFr + birthdayTo + isShowAllAsso;
              
        }
        protected void cboClientName_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            STEPS_Client_DataAdapter clientDA = new STEPS_Client_DataAdapter();
            RadComboBox cboClientName = (RadComboBox)o;
            cboClientName.Items.Clear();
              
              
      
            Int64 EmployeeId;
            string inputText = e.Text;
            int isShowAllName = 1;
            string isStartWith = "true";
            string clientSysType = "";
            string subType = "";
            if (_employeeId != null)
            {
                if (Int64.TryParse(_employeeId, out EmployeeId))
                {
                    if (e.Context["ClientType"] != null) {
                        switch(e.Context["ClientType"].ToString()){
                            case "All":
                                clientSysType = "";
                                subType = "";
                                break;
                            case "Contact":
                                clientSysType = "Contact";
                                subType = "";
                                break;
                            case "Company":
                                clientSysType = "Company";
                                subType = "";
                                break;
                            case "Brand":
                                clientSysType = "Company";
                                subType = "Brand";
                                break;
                            case "Agency":
                                clientSysType = "Company";
                                subType = "Agent";
                                break;
                        }
                    }
      
                    if (e.Context["IsShowAllAsso"] != null)
                    {
                        isShowAllName = 1;
                    }
                    else {
                        isShowAllName = 0;
                    }
      
                    inputText += "%";
      
                    cboClientName.DataSource = clientDA.GetClientNameDataSet(inputText, EmployeeId, clientSysType, subType, isShowAllName);
                    cboClientName.DataTextField = "Name";
                    cboClientName.DataValueField = "Name";
                    cboClientName.DataBind();
      
                }
                else
                {
                    cboClientName.DataSource = null;
                    cboClientName.DataTextField = "Name";
                    cboClientName.DataValueField = "Name";
                    cboClientName.DataBind();
                }
            }
      
        }
        protected void mnuClientNew_ItemClick(object sender, RadMenuEventArgs e)
        {
            if (e.Item.Value == "Contact") {
                frameClient.Attributes["src"] = "./EditForm/Edit_Client.aspx?EmployeeId=" + _employeeId + "&ClientSysType=Contact";
            }else if (e.Item.Value == "Company") {
                frameClient.Attributes["src"] = "./EditForm/Edit_Client.aspx?EmployeeId=" + _employeeId + "&ClientSysType=Company";
            }else if (e.Item.Value == "Brand"){
                frameClient.Attributes["src"] = "./EditForm/Edit_Client.aspx?EmployeeId=" + _employeeId + "&ClientSysType=Contact&SubType=Brand";
            }else if (e.Item.Value == "Agent"){
                frameClient.Attributes["src"] = "./EditForm/Edit_Client.aspx?EmployeeId=" + _employeeId + "&ClientSysType=Contact&SubType=Agent";
            }
        }
      
        protected void btnStkSearch_Click(object sender, EventArgs e)
        {
            RadPanelItem stockItem = barMenuLeft.Items.FindItemByValue("cboStkLocation");
            RadPanelItem stockExpressItem = stockItem.Items.FindItemByValue("Stock_Express");
            RadPanelItem stockExpressSearchItem = stockExpressItem.Items.FindItemByValue("Stock_Express_Search");
            RadComboBox cboStkLocation = (RadComboBox)stockExpressSearchItem.FindControl("cboStkLocation");
            RadNumericTextBox txtStkStreetFr = (RadNumericTextBox)stockExpressSearchItem.FindControl("txtStkStreetFr");
            RadNumericTextBox txtStkStreetTo = (RadNumericTextBox)stockExpressSearchItem.FindControl("txtStkStreetTo");
            RadComboBox cboStkOwner = (RadComboBox)stockExpressSearchItem.FindControl("cboStkOwner");
            string location = null;
            string streetFr = null;
            string streetTo = null;
            string owner = null;
      
            if (cboStkLocation.SelectedValue != "") { 
                  
            }
      
            if (txtStkStreetFr.Text != "") { 
              
            }
      
            if (txtStkStreetTo.Text != "") { 
              
            }
      
            if (cboStkOwner.SelectedValue != "") { 
              
            }
      
            frameClient.Attributes["src"] = "./Main_Detail_Panel.aspx?AccessForm=Stock&Action=Stock_Search&EmployeeId=" + _employeeId;
        }
      
        protected void cboStkLocation_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            if (e.Text.Length >= 2)
            {
                RadComboBox cbo = (RadComboBox)o;
                string inputText = e.Text;
                STEPS_Bound5_DataAdapter bound5DA = new STEPS_Bound5_DataAdapter();
                cbo.DataSource = bound5DA.GetBound5WithNameDataSet(inputText + "%");
                cbo.DataTextField = "Bound5_Name";
                cbo.DataValueField = "Bound5_Id";
                cbo.DataBind();
            }
        }
    }
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 07 Sep 2010 Link to this post

    Try changing the Expand and Collapse animation to None and see if that helps.

    Here's a demo which does just that:

    http://demos.telerik.com/aspnet-ajax/panelbar/examples/functionality/expandanimation/defaultcs.aspx

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CH
    CH avatar
    28 posts
    Member since:
    Nov 2008

    Posted 07 Sep 2010 Link to this post

    Thanks Cori,
    my panelbar control already used the "Expand and Collapse animation to None " but it didn't give too much help. actually, if it add more control into the panelbar template the speed of expand and collapse will serious degraded. is it the limitation for telerik panelbar... or any work around to solve it?

    From CH
  5. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 09 Sep 2010 Link to this post

    Hello CH,

    I am trying to find where exactly do you add the controls (the additional controls you mentioned slowing down the panelBar expand/collapse behavior), but I am unable to.
    Please, specify the way and the time (of the page lifecycle) you add the controls to the panel bar. Probably you can post some additional, missing here, code (or maybe I missed it - if that is the case, I apologize).

    Hope that soon we will resolve this problem!


    Regards,
    Nikolay Tsenkov
    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. CH
    CH avatar
    28 posts
    Member since:
    Nov 2008

    Posted 04 Oct 2010 Link to this post

    Dear Sir:
       Thank you for testing the code... finally i solved the the performance issue..

    From CH
  7. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 06 Oct 2010 Link to this post

    Hi CH,

    Glad you managed to solve this one!


    Regards,
    Nikolay Tsenkov
    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. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 29 Mar 2011 Link to this post

    I know it's a little after the event, but do you want to tell us /how/ you solved the problem?

    --
    Stuart
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017