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

issue in hiding radpanes

3 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sudhakar
Top achievements
Rank 1
Sudhakar asked on 02 Sep 2014, 08:53 AM
Hi,
I have three radpanes displaying on the screen.When i click on the first child(see attachment) in pane 1 need to hide pane 3 and when i click on the second child need to hide pane 2.
aspx file:
function RequestInitiated(sender, args) {
                if (!ajaxLocked) {
                    var ajaxArg = args._eventArgument;
                    currentLoadingPanel = $find("<%= loadingPanelOverlay.ClientID %>");
                    if (ajaxArg.split('/')[0] == "treeNodeSelected") {
                        currentUpdatedControl = "<%= BalanceRadGrid.ClientID %>";
                    }
                     else if (ajaxArg.split('/')[0] == "selectedDateChanged") {
                        currentUpdatedControl = "<%= ShiftTreeView.ClientID %>";
                    } else if (ajaxArg.split('/')[0] == "shipmentNodeSelected") {
                        currentUpdatedControl = "<%= ShipmentRadGrid.ClientID %>";
                    }                  
                    else if (ajaxArg.split('/')[0] == "sendToDevice") {
                        currentUpdatedControl = "<%= ShiftTreeView.ClientID %>";
                        currentLoadingPanel.show(currentUpdatedControl);
                    }
                    ajaxLocked = true;
                }
            }

 function treeNodeItemSelected(sender, eventArgs) {
                debugger;
                if (ajaxLocked) {
                    return;
                }
                if (treeState) {
                    treeState = false;
                    var nodeType = eventArgs._node._attributes.getAttribute("NodeType");
                    if (nodeType == "Vehicle") {
                        var shiftIndex = eventArgs._node._attributes.getAttribute("ShiftIndex");
                        $find("ctl00_ContentDisplay_radAjaxManager").ajaxRequest("treeNodeSelected" + "/" + sender._element.value + "/" + shiftIndex);
                    }
                    //added by sudhakar for 1.06.02 requirement
                    else if (nodeType == "Shipment") {
                    var vehicleId = eventArgs._node._attributes.getAttribute("VehicleId");
                    $find("ctl00_ContentDisplay_radAjaxManager").ajaxRequest("shipmentNodeSelected" + "/" + sender._element.value + "/" + vehicleId);
                    }
                    //added by sudhakar for 1.06.02 requirement
                }
                setTimeout(function() {
                    if (!treeState) {
                        treeState = true;
                    }
                }, 1000);
                setInterval(function() {
                     shipmentSectionId = "<%= ShipmentRadGrid.ClientID %>";
                    currentLoadingPanel = $find("<%= loadingPanelOverlay.ClientID %>");
                    currentLoadingPanel.hide(shipmentSectionId);
                }, 1000);
            }
<div id="contentHolder">
       
        <telerik:RadSplitter Orientation="Vertical" ID="RadSplitterMain" runat="server" Width="970px"
            Height="600px">
            <telerik:RadPane ID="ShiftPane" runat="server" Width="20%" CssClass="noOverflow">
                <div class="paneHeader">
                    <div class="paneHeaderBorder">
                        <span class="headerPaneText">
                            <asp:Label ID="lbl_ShiftHeader" runat="server"></asp:Label></span>
                    </div>
                </div>
                <!-------------------------------------
                  ---------SHIFT SECTION---------------
                  ------------------------------------->
                 
                  <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server" onload="UpdatePanel1_Load">
                   <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnAutoRefresh" EventName="Click" />
                    </Triggers>
                   
                   <ContentTemplate>
                  
                  <div id="refreshSection" style="height: 35px">
                                <telerik:RadButton ID="btnAutoRefresh" EnableTheming="False" EnableViewState="False"
                                ButtonType="SkinnedButton" Height="19px" Font-Size="XX-Small" OnClick="btnAutoRefresh_OnClick"
                                CssClass="autoRefreshButton" runat="server"></telerik:RadButton>    
                                <%--<asp:Button ID="btnAutoRefresh" Height="19px" OnClick="btnAutoRefresh_OnClick" Font-Size="XX-Small"
                                CssClass="FilterComboItem clsButOK" Text="Refresh" runat="server" />--%>
                </div>
               
               
                  
               
               
                <div id="divShftTree">
                <telerik:RadAjaxPanel ID="ShiftPanel" runat="server" CssClass="radPaneContentFull mediumPadding">
                    <div id="datePickerDiv">
                        <asp:Label for="RadDate_ShiftFrom" id="lblFromDate" runat="server"></asp:Label>
                       
                        <telerik:RadDatePicker runat="server" ID="RadDate_ShiftFrom">
                            <Calendar runat="server">
                                <SpecialDays>
                                    <telerik:RadCalendarDay >
                                    </telerik:RadCalendarDay>
                                </SpecialDays>
                            </Calendar>
                            <ClientEvents OnDateSelected="OnSelectedDateChanged" />
                        </telerik:RadDatePicker>
                        <br />
                        <asp:Label for="RadDate_ShiftTo" id="lblToDate" runat="server">
                            </asp:Label>
                        <telerik:RadDatePicker runat="server" ID="RadDate_ShiftTo">
                            <Calendar runat="server">
                                <SpecialDays>
                                    <telerik:RadCalendarDay >
                                    </telerik:RadCalendarDay>
                                </SpecialDays>
                            </Calendar>
                            <ClientEvents OnDateSelected="OnSelectedDateChanged" />
                        </telerik:RadDatePicker>
                    </div>
                    <telerik:RadTreeView ID="ShiftTreeView" runat="server" OnClientContextMenuItemClicked="contextMenuItemSelected"
                        OnClientContextMenuShowing="onShowingContextMenu" OnClientDoubleClick="doubleClickedNode"
                        OnClientNodeClicked="treeNodeItemSelected" OnClientLoad="AddInfoToMenu" Height="440px">
                        <ContextMenus>
                            <telerik:RadTreeViewContextMenu ID="ShiftTreeContextMenu" runat="server">
                            </telerik:RadTreeViewContextMenu>
                        </ContextMenus>
                    </telerik:RadTreeView>
                </telerik:RadAjaxPanel>
                </div>
               </ContentTemplate>
                </asp:UpdatePanel>
            </telerik:RadPane>
            <telerik:RadSplitBar runat="server" ID="RadSplitBar1" EnableResize="false">
            </telerik:RadSplitBar>
            <!--added by sudhakar for 1.06.01 requirement  start-->
            <telerik:RadPane ID="vehicleIDPane" runat="server" Width="80%" CssClass="noOverflow">
                <div class="paneHeader">
                    <div class="paneHeaderBorder">
                        <span class="headerPaneText">
                            <asp:Label ID="lbl_ShipementForVehicle"  runat="server"></asp:Label></span>
                    </div>
                </div>
                <!-----------------------------------
                  ---------SHIPMENT For VehicleID SECTION -----------
                  ------------------------------------->
                <div id="vehicleIDPane1" runat="server" class="radPaneContent">
                <telerik:RadAjaxPanel ID="FilterOptionPanel" CssClass="FilterSection" runat="server">
                <table>
                    <tr>
                        <td><asp:Label runat="server" Font-Bold="true" ID="lbl_shiftStart" ></asp:Label></td>
                        <td><asp:TextBox runat="server" ID="txt_shiftStartValue" CssClass="shiftDivTextBoxDate" Enabled="false"></asp:TextBox></td>
                    <td></td>
                        <td><asp:Label runat="server" Font-Bold="true" ID="lbl_shiftEnd" ></asp:Label></td>
                        <td><asp:TextBox runat="server" ID="txt_shiftEndValue"  CssClass="shiftDivTextBoxDate" Enabled="false"></asp:TextBox></td>
                    </tr>
                </table>
                </telerik:RadAjaxPanel>
            <telerik:RadGrid
                runat="server"
                ID="BalanceRadGrid" ShowHeader="true">
                <%--OnNeedDataSource="ErrorRadGrid_NeedDataSource"--%>
            <MasterTableView
                    AutoGenerateColumns="false"
                    ShowHeadersWhenNoRecords="true"
                    PageSize="50"
                    >                    
                <Columns>
                    <telerik:GridBoundColumn  DataField="ProductName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="PriorToLoad" UniqueName="PriorToLoad"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="ActualLoadQuantity" UniqueName="LoadedQty"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="ActualDischargeQuantity" UniqueName="DischargeQty"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="LeftOnBoard" UniqueName="LeftOnBoard"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="" DataField="ShipmentId" UniqueName="ShipmentId" Visible="false"> </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="" DataField="PlannedSequence" UniqueName="PlannedSequence" Visible="false"> </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="" DataField="PlannedSequence" UniqueName="ActualSequence" Visible="false"> </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        </div>
        </telerik:RadPane>
        <telerik:RadSplitBar runat="server" ID="RadSplitBar2" EnableResize="false">
            </telerik:RadSplitBar>
            <!--added by sudhakar for 1.06.01 requirement  end-->
           
            <telerik:RadPane ID="ShipmentPane" runat="server" Width="60%" CssClass="noOverflow">
                <div class="paneHeader">
                    <div class="paneHeaderBorder">
                        <span class="headerPaneText">
                            <asp:Label ID="lbl_ShipmentHeader" runat="server"></asp:Label></span>
                    </div>
                </div>
                <!-----------------------------------
                  ---------SHIPMENT SECTION -----------
                  ------------------------------------->
                 
                <div id="ShipmentPanel" runat="server" class="radPaneContent">
                <telerik:RadAjaxPanel ID="RadAjaxPanel1" CssClass="FilterSection" runat="server">
                <table>
                    <tr>
                        <td><asp:Label runat="server" Font-Bold="true" ID="lbl_ShipmentNo" ></asp:Label></td>
                        <td><asp:TextBox runat="server" ID="txt_ShipmentNo" CssClass="shiftDivTextBoxDate" Enabled="false"></asp:TextBox></td>
                        <td></td>
                        <td><asp:Label runat="server" Font-Bold="true" ID="lbl_ShipmentStart" ></asp:Label></td>
                        <td><asp:TextBox runat="server" ID="txt_ShipmentStartValue" CssClass="shiftDivTextBoxDate" Enabled="false"></asp:TextBox></td>
                    <td></td>
                        <td><asp:Label runat="server" Font-Bold="true" ID="lbl_ShipmentEnd" ></asp:Label></td>
                        <td><asp:TextBox runat="server" ID="txt_ShipmentEndValue"  CssClass="shiftDivTextBoxDate" Enabled="false"></asp:TextBox></td>
                    </tr>
                </table>
                </telerik:RadAjaxPanel>
                    <telerik:RadGrid AllowPaging="True" ShowStatusBar="true" ID="ShipmentRadGrid" BorderStyle="None"
                        AllowSorting="True" runat="server" AutoGenerateColumns="false" OnDetailTableDataBind="ShipmentRadGrid_DetailTableDataBind"
                        AllowFilteringByColumn="true" OnNeedDataSource="ShipmentRadGrid_NeedDataSource"
                         Height="230px" Width="475px">
                        <%--<MasterTableView ShowHeadersWhenNoRecords="true" DataKeyNames="Vehicle_ID,Shipment_ID"
                            ClientDataKeyNames="Vehicle_ID,Shipment_ID" PageSize="50">
                            <DetailTables>
                                <telerik:GridTableView DataKeyNames="Transfer_ID, TransferType" ClientDataKeyNames="Transfer_ID, TransferType"
                                    Name="ShipmentType" AutoGenerateColumns="false" ShowHeadersWhenNoRecords="true"
                                    AllowFilteringByColumn="false">
                                    <DetailTables>
                                        <telerik:GridTableView Name="ShipmentDetail" AutoGenerateColumns="false" ShowHeadersWhenNoRecords="true"
                                            AllowFilteringByColumn="false" NoDetailRecordsText="Invalid Data">
                                            <Columns>
                                                <telerik:GridBoundColumn HeaderText="Planned Product" DataField="PlannedProductName"
                                                    AllowFiltering="false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn HeaderText="Planned Values" DataField="PlannedQuantity"
                                                    AllowFiltering="false">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn HeaderText="Actual Values" DataField="ActualQuantity" AllowFiltering="false">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="Transfer_ID" UniqueName="Transfer_ID"
                                            AllowFiltering="false">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="TransferType" UniqueName="TransferType"
                                            AllowFiltering="false">
                                            <HeaderStyle Width="130px" />
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </telerik:GridTableView>
                            </DetailTables>
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="Shipment_ID" DataField="Shipment_ID" ReadOnly="true">
                                <HeaderStyle Width="270px" />
                                </telerik:GridBoundColumn>
                            </Columns>
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="ShipmentState" DataField="ShipmentState" Display="false">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>--%>
                        <MasterTableView
                    AutoGenerateColumns="false"
                    ShowHeadersWhenNoRecords="true"
                    PageSize="50"
                    >                    
                <Columns>
                    <telerik:GridBoundColumn  DataField="ProductName"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="PriorToLoad" UniqueName="PriorToLoad"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="ActualLoadQuantity" UniqueName="LoadedQty"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="ActualDischargeQuantity" UniqueName="DischargeQty"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn  DataField="LeftOnBoard" UniqueName="LeftOnBoard"></telerik:GridBoundColumn>                   
                </Columns>
            </MasterTableView>
                        <%--<ClientSettings>
                            <Selecting AllowRowSelect="true" />
                            <ClientEvents OnRowSelected="OnRowSelect_RowDataSelected" OnRowDblClick="OnRowDouble_DetailTable" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>
                        </ClientSettings>--%>
                    </telerik:RadGrid>
                </div>
                </telerik:RadPane>
              
           
       
       
        </telerik:RadSplitter>
      
    </div>

aspx.cs file:
protected void PopulateTreeNode()
    {
        ShiftTreeView.Nodes.Clear();
        ShiftTreeContextMenu.Items.Clear();
        RadMenuItem menuItem1 = new RadMenuItem(MyGlobal.SDP_GUI_WORKSCHED_MENU_SENDTOGSAP);
        RadMenuItem menuItem2 = new RadMenuItem(MyGlobal.SDP_GUI_WORKSCHED_MENU_SENDTODEV);
        RadMenuItem menuItem3 = new RadMenuItem(MyGlobal.SDP_GUI_ERROR_LBL_HEADER);
        RadMenuItem menuItem4 = new RadMenuItem(MyGlobal.SDP_GUI_WORKSCHED_MENU_DISCHSCRN);
        RadMenuItem menuItem5 = new RadMenuItem(MyGlobal.SDP_GUI_WORKSCHED_MENU_BLNCSHEET);
        RadMenuItem menuItem6 = new RadMenuItem(MyGlobal.SDP_GUI_WORKSCHED_MENU_SHFITOVERV);
        RadMenuItem menuItem7 = new RadMenuItem(MyGlobal.SDP_GUI_WS_DELETE_SHIFT);
        menuItem1.Value = "SendToGsap";
        menuItem2.Value = "SendToDevice";
        menuItem3.Value = "ErrorLog";
        menuItem4.Value = "DischargeScreen";
        menuItem5.Value = "BalanceSheet";
        menuItem6.Value = "ShiftOverview";
        menuItem7.Value = "DropShift";
        ShiftTreeContextMenu.Items.Add(menuItem1);
        ShiftTreeContextMenu.Items.Add(menuItem2);
        ShiftTreeContextMenu.Items.Add(menuItem3);
        ShiftTreeContextMenu.Items.Add(menuItem4);
        ShiftTreeContextMenu.Items.Add(menuItem5);
        ShiftTreeContextMenu.Items.Add(menuItem6);
        ShiftTreeContextMenu.Items.Add(menuItem7);
        //shiftList.Sort((x, y) => DateTime.Compare(x.ScheduledDate, y.ScheduledDate));
        if (shiftList == null)
        { return; }
        shiftList = shiftList.OrderBy(x => x.ScheduledDate).ThenBy(y => y.ShiftIndex).ToList();
        shiftList.Reverse();
        //ShipmentState currentShipmentState = new ShipmentState();
        ShiftState currentShiftState = new ShiftState();
        foreach (ShiftEntity s in shiftList)
        {
            if (!isWithinDate(s))
            {
                continue;
            }
            List<Int64> vehicleIdList = new List<Int64>();
            String timeOfDay = "";
            if (s.ShiftIndex == 1) { timeOfDay = "AM"; }
            if (s.ShiftIndex == 2) { timeOfDay = "PM"; }
            RadTreeNode rootNode = new RadTreeNode(s.ScheduledDate.Date.ToShortDateString() + " / " + timeOfDay);
            Boolean disableDelete = false;
            //shipmentList.Sort((x,y)=> x.Vehicle_ID.CompareTo(y.Vehicle_ID));
            tempShipmentList = shipmentList.FindAll(sh => sh.Shift_ID == s.Shift_ID);
            //currentShipmentState =  ShipmentState.NotSet;
            currentShiftState = ShiftState.NotSet;
            string shiftdate = s.ScheduledDate.ToString("dd-MM-yyyy") + " / " + timeOfDay;
            ///
            // Creating vehicle nodes under shifts
            ///
            foreach (ShipmentEntity sm in tempShipmentList)
            {
                RadTreeNode shipmentNode = new RadTreeNode(sm.Vehicle_ID.ToString());
                shipmentNode.Value = sm.Vehicle_ID.ToString();
                if (sm.ShipmentState == ShipmentState.Ignored)
                {
                    sm.ShipmentState = ShipmentState.ReceivedFromAppWithError;
                }
                shipmentNode.ImageUrl = "~/images/States/" + sm.ShipmentState.ToString() + ".png";
                shipmentNode.Attributes.Add("NodeType", "Vehicle");
                shipmentNode.Attributes.Add("ShipmentType", sm.ShipmentState.ToString());
                shipmentNode.Attributes.Add("VehicleId", sm.Vehicle_ID.ToString());
                shipmentNode.Attributes.Add("ShiftIndex", sm.Shift_ID.ToString());
                //7363
                shipmentNode.Attributes.Add("ShiftDate", shiftdate);
                if (!vehicleIdList.Contains(sm.Vehicle_ID))
                {
                    rootNode.Nodes.Add(shipmentNode);
                    vehicleIdList.Add(sm.Vehicle_ID);
                    //currentShipmentState = ShipmentState.NotSet;
                }
                if (!(sm.ShipmentState.Equals(ShipmentState.NewShiftReady)) && !disableDelete)
                {
                    disableDelete = true;
                }
                ///
                // Prioritising vehicle node status based on individual shipments
                ///
                String vehicleShipmentNodeType =
                    rootNode.Nodes.FindNodeByValue(sm.Vehicle_ID.ToString()).Attributes["ShipmentType"];
                if (vehicleShipmentNodeType != sm.ShipmentState.ToString())
                {
                    if (IsErrorHighPriority(sm.ShipmentState.ToString(), vehicleShipmentNodeType))
                    {
                        rootNode.Nodes.FindNodeByValue(sm.Vehicle_ID.ToString()).Remove();
                        rootNode.Nodes.Add(shipmentNode);
                    }
                }
                //adding code to bind new shipment node to tree view
                //List<ShipmentEntity> shipmentIDList = new List<ShipmentEntity>();
                //foreach (ShipmentEntity sid in shipmentIDList)
                //{
                //    RadTreeNode shipmentidnode = new RadTreeNode(sid.Shipment_ID.ToString());
                //    shipmentidnode.Value = sid.Shipment_ID.ToString();
                   
                //        shipmentNode.Nodes.Add(shipmentidnode);
                   
                //}
                List<ShipmentEntity> shipmentIDList = new List<ShipmentEntity>();
                shipmentIDList = tempShipmentList.FindAll(sh => sh.Vehicle_ID == sm.Vehicle_ID);
                foreach (ShipmentEntity sid in shipmentIDList)
                {
                    RadTreeNode shipmentidnode = new RadTreeNode(sid.Shipment_ID.ToString());
                    shipmentidnode.Value = sid.Shipment_ID.ToString();
                    shipmentidnode.Attributes.Add("NodeType", "Shipment");
                    shipmentidnode.Attributes.Add("VehicleId", sid.Vehicle_ID.ToString());
                    shipmentidnode.Attributes.Add("ShiftIndex", sid.Shift_ID.ToString());
                    shipmentNode.Nodes.Add(shipmentidnode);
                }
               
            }

            ///
            // Adding vehicle nodes to shift nodes
            ///
            if (disableDelete)
            {
                rootNode.Attributes.Add("DisableDelete", "True");
            }
            String shipmentString = "";
            Boolean sendToGsap = false;
            Boolean sendToDev = false;
            ShiftState tracker = new ShiftState();
            //6505
            List<RadTreeNode> vehiclenodecollection = new List<RadTreeNode>();
           
            foreach (RadTreeNode rtn in rootNode.Nodes)
            {
               
                shipmentString = rtn.Attributes["ShipmentType"].ToString();
                tracker = (ShiftState)Enum.Parse(typeof(ShiftState), shipmentString);
               
                if (currentShiftState == ShiftState.NotSet)
                {
                    currentShiftState = (ShiftState)Enum.Parse(typeof(ShiftState), shipmentString);
                }
                if (currentShiftState != tracker)
                {
                    currentShiftState = ShiftState.IncompleteShift;
                }
               
                if( shipmentString.Equals(ShipmentState.ReceivedFromAppNoError.ToString()) &&
                    !sendToGsap && user.UserType != "VW")
                {
                    rootNode.Attributes.Add("EnableSendToGsap", "True");
                    sendToGsap = true;
                }
                if (shipmentString.Equals(ShipmentState.NewShiftReady.ToString()) && !sendToDev)
                {
                    rootNode.Attributes.Add("EnableSendToDevice", "True");
                    sendToDev = true;
                }
                if (user.UserType == "VW")
                { rtn.Attributes.Add("EnableSendToDevice", "SHELLSUPPORT"); }
                if (!user.ScreenLevelAccess.Contains("EL"))
                { rtn.Attributes.Add("EnableErrorLog", "False"); }
                vehiclenodecollection.Add(rtn);
            }
            var q = from node in vehiclenodecollection
                    orderby node.Text ascending
                    select node;
            rootNode.Nodes.Clear();
            foreach (RadTreeNode nd in q)
            {
                rootNode.Nodes.Add(nd);
            }
            s.Status = currentShiftState;
            if (s.Status == ShiftState.ReceivedFromAppNoError && user.UserType != "VW")
            {
                rootNode.Attributes.Add("EnableSendToGsap", "True");
            }
            if (user.UserType == "VW")
            { rootNode.Attributes.Add("EnableSendToDevice", "SHELLSUPPORT"); }
            //R2:1.34 user profile screen level access
            if (! user.ScreenLevelAccess.Contains("EL"))
            { rootNode.Attributes.Add("EnableErrorLog", "False"); }
            //if (!user.ScreenLevelAccess.Contains("AT"))
            //{ rootNode.Attributes.Add("EnableAuditTrail", "False"); }
           
            rootNode.Value = s.Shift_ID.ToString();
            rootNode.Attributes.Add("NodeType", "Shift");
            rootNode.Attributes.Add("ShiftId", s.Shift_ID.ToString());
            rootNode.ImageUrl = "~/images/States/" + s.Status.ToString() + ".png";
            ShiftTreeView.Nodes.Add(rootNode);
        }
        if (Session["haulierLocationFlag"] != null)
        {
            if (Session["haulierLocationFlag"].ToString() == "true")
            {
                //ShiftTreeView.Nodes.Clear();
                //ShiftTreeContextMenu.Items.Clear();
                Session["haulierLocationFlag"] = false;
                List<ShipmentEntity> shipmentEntityCount = new List<ShipmentEntity>();
                ShipmentRadGrid.DataSource = shipmentEntityCount;
            }
        }
        else
        {
            Session["haulierLocationFlag"] = false;
        }
        if (Session["haulierFlag"] != null)
        {
            if (Session["haulierFlag"].ToString() == "true")
            {
                Session["haulierLocationFlag"] = false;
                //lbl_LoadingHeader.Text = string.Empty;
                //lbl_DischargeHeader.Text = string.Empty;
                Session[_lastDischargeHeader] = string.Empty;
                Session[_lastLoadHeader] = string.Empty;
                List<ShipmentEntity> shipmentEntCount = new List<ShipmentEntity>();
                ShipmentRadGrid.DataSource = shipmentEntCount;
            }
        }
        else
        {
            Session["haulierFlag"] = false;
        }
    }
protected void radAjaxManager_OnAjaxRequest(object sender, AjaxRequestEventArgs e)
    {
       
        String calledBy = e.Argument.Split('/')[0];
        switch (calledBy)
        {
                        case "treeNodeSelected":
                {
                    StoreGridDataInSession(Constants.SessionDataStoreKeys.EntireShipment.ToString());
                    //Int64 vehicleId = Int64.Parse(e.Argument.Split('/')[1]);
                    //Int64 shiftIndex = Int64.Parse(e.Argument.Split('/')[2]);
                    String shiftValue = ShiftTreeView.SelectedNode.ParentNode.Value.ToString();
                    String vehicleValue = ShiftTreeView.SelectedValue.ToString();
                    string shiftstart = ShiftTreeView.SelectedNode.ParentNode.Text.ToString();
                    //added by sudhakar for 1.06.01 requirement start
                    List<BalanceEntity> balanceList = new List<BalanceEntity>();
                    Session[_lastShiftValue] = shiftValue;
                    Session[_lastVehicle] = vehicleValue;
                    //vehclelst = Session[_VehicleList].ToString();
                    vehclelst = null;
                    lbl_ShipementForVehicle.Text = "<span style='font-weight: bold'>" + MyGlobal.SDP_GUI_WORKSCHED_LBL_SHIFT + "-" + shiftstart.ToString() + "-" + vehicleValue.ToString() + "</span>";
                    bool IsVehicleSelected = false;
                    balanceList = balanceManager.GetBalanceListByVehicleOnShift(Int64.Parse(shiftValue), Int64.Parse(vehicleValue), user.SelectedHaulierID);
                    Session[_lastSubmitType] = "Vehicle";
                    IsVehicleSelected = true;                              
                    if (balanceList.Count > 0)
                    {
                        //txt_shiftStartValue.Text = balanceList[0].ShiftStart.ToString();
                        //txt_shiftEndValue.Text = balanceList[0].ShiftEnd.ToString();
                        if (IsVehicleSelected)
                        {
                            txt_shiftStartValue.Text = (balanceList[0].ShiftStart == null)
                                                            ? MyGlobal.SDP_GUI_NOT_STARTED
                                                            : balanceList[0].ShiftStart <= DateTime.MinValue
                                                                ? MyGlobal.SDP_GUI_NOT_STARTED
                                                                : balanceList[0].ShiftStart.ToString();
                            txt_shiftEndValue.Text = (balanceList[0].ShiftEnd == null)
                                                            ? MyGlobal.SDP_GUI_NOT_FINISHED
                                                            : balanceList[0].ShiftEnd <= DateTime.MinValue
                                                                ? MyGlobal.SDP_GUI_NOT_FINISHED
                                                                : balanceList[0].ShiftEnd.ToString();
                        }
                        else
                        {
                            txt_shiftStartValue.Text = "--";
                            txt_shiftEndValue.Text = "--";
                        }
                        //BalanceRadGrid.MasterTableView.Columns[0].t
                        BalanceRadGrid.DataSource = balanceList;
                        Session[_lastBalanceResult] = balanceList;
                        GridGroupByExpression expression1 = GridGroupByExpression.Parse("ShipmentId [" + MyGlobal.SDP_GUI_BALANCE_CAPT_SHIPMENTID + "] Group By ActualSequence");
                        BalanceRadGrid.MasterTableView.GroupByExpressions.Add(expression1);
                        BalanceRadGrid.DataBind();
                    }
                    if (balanceList.Count == 0)
                    {
                        txt_shiftStartValue.Text = "";
                        txt_shiftEndValue.Text = "";
                        BalanceRadGrid.DataSource = balanceList;
                        GridGroupByExpression expression1 = GridGroupByExpression.Parse("ShipmentId [" + MyGlobal.SDP_GUI_BALANCE_CAPT_SHIPMENTID + "] Group By ActualSequence");
                        BalanceRadGrid.MasterTableView.GroupByExpressions.Add(expression1);
                        BalanceRadGrid.DataBind();
                        //added by sudhakar for 1.06.01 requirement end
                        //Response.Redirect("Portals/Balance.aspx?ShiftIndex=" + shiftIndex + "&VehicleId=" + vehicleId,false);
                        //commented by sudhakar for 1.06.01 requirement start
                        //commented by sudhakar for 1.06.01 requirement end
                       
                       
                       
                    }
                    //LoadingDischargePane.Visible = false;
                    ShipmentPane.Visible = false;
                    ShipmentPanel.Visible = false;
                    //LoadingPanel.Visible = false;
                    //DischargePanel.Visible = false;
                    ////RadPane1.Visible = false;
                   
                    ////RadSplitter1.Visible = false;
                    vehicleIDPane.Visible = true;
                    break;
                }
            case "shipmentNodeSelected":
                {
                    StoreGridDataInSession(Constants.SessionDataStoreKeys.EntireShipment.ToString());
                    Int64 shipmentID = Int64.Parse(e.Argument.Split('/')[1]);
                    Int64 vehicleId = Int64.Parse(e.Argument.Split('/')[2]);
                    //Int64 vehicleId = Int64.Parse(e.Argument.Split('/')[2]);
                    Session[_lastShipmentSelect] = shipmentID.ToString();
                    bool IsShipmenteSelected = false;
                    lbl_ShipmentHeader.Text = "<span style='font-weight: bold'>" + MyGlobal.SDP_GUI_WORKSCHED_LBL_SHIPMEMT + " <" + shipmentID.ToString() + ">" + "</span>";
                    //ShipmentRadGrid.MasterTableView.GetColumn("Shipment_ID").HeaderText = "<span style='font-weight: bold'>" + MyGlobal.SDP_GUI_WORKSCHED_LBL_SHIPMEMTS + " [" + shipmentID + "]" + "</span>";
                    List<BalanceEntity> shipmentInstance;
                    shipmentInstance = balanceManager.GetBalanceEntityFromShipment(shipmentID, vehicleId);
                    IsShipmenteSelected = true;
                    if (shipmentInstance.Count > 0)
                    {
                        if (IsShipmenteSelected)
                        {
                            txt_ShipmentStartValue.Text = (shipmentInstance[0].ShipmentStart == null)
                                                            ? MyGlobal.SDP_GUI_NOT_STARTED
                                                            : shipmentInstance[0].ShipmentStart <= DateTime.MinValue
                                                                ? MyGlobal.SDP_GUI_NOT_STARTED
                                                                : shipmentInstance[0].ShipmentStart.ToString();
                            txt_ShipmentEndValue.Text = (shipmentInstance[0].ShipmentEnd == null)
                                                            ? MyGlobal.SDP_GUI_NOT_FINISHED
                                                            : shipmentInstance[0].ShipmentEnd <= DateTime.MinValue
                                                                ? MyGlobal.SDP_GUI_NOT_FINISHED
                                                                : shipmentInstance[0].ShipmentEnd.ToString();
                            txt_ShipmentNo.Text = (shipmentInstance[0].ShipmentId == null)
                                                            ? MyGlobal.SDP_GUI_NOT_STARTED
                                                                : shipmentInstance[0].ShipmentId.ToString();
                        }
                        else
                        {
                            txt_ShipmentStartValue.Text = "--";
                            txt_ShipmentEndValue.Text = "--";
                        }
                    }
                    if (shipmentInstance.Count == 0)
                    {
                        txt_ShipmentStartValue.Text = "";
                        txt_ShipmentStartValue.Text = "";
                    }
                    loadingDetailWsList = new List<LoadingDetailExtraEntity>();
                    loadingDetailWsList = loadingDetailManager.GetLoadingDetailByShipmentId(shipmentID);
                    //LoadingRadGrid.DataSource = loadingDetailWsList;
                    //LoadingRadGrid.DataBind();
                    dischargeDetailWsList = new List<DischargeDetailExtraEntity>();
                    dischargeDetailWsList = dischargeDetailManager.GetDischargesByShipmentId(shipmentID);
                    //DischargeRadGrid.DataSource = dischargeDetailWsList;
                    //DischargeRadGrid.DataBind();
                    //List<LoadingDetailEntity> loadinginstance;
                    //loadinginstance = loadingDetailManager.GetLoadingDetailByShipmentId(shipmentID);
                    //LoadingRadGrid.DataSource = loadinginstance;
                    //List<DischargeDetailEntity> dishargeinstance;
                    //dishargeinstance = dischargeDetailManager.GetDischargeDetailListByShipmentId(shipmentID);
                    //DischargeRadGrid.DataSource = dishargeinstance;
                    //lbl_LoadingHeader.Text = MyGlobal.SDP_GUI_WORKSCHED_LBL_LOADING;
                    //lbl_DischargeHeader.Text = MyGlobal.SDP_GUI_WS_DISCHARGING;
                    Session.Remove(_lastShipmentSelect);
                    Session.Remove(_lastLoadingSelect);
                    Session.Remove(_lastDischargeSelect);
                    Session.Remove(_lastDischargeHeader);
                    Session.Remove(_lastLoadHeader);
                    ShipmentRadGrid.DataSource = shipmentInstance;
                    ShipmentRadGrid.Rebind();
                    //vehicleIDPane.Visible = false;
                    //LoadingDischargePane.Visible = true;
                    ShipmentPane.Visible = true;
                    ShipmentPanel.Visible = true;
                    //LoadingPanel.Visible = true;
                    //DischargePanel.Visible = true;
                    //RadPane1.Visible = true;
                    //RadSplitter1.Visible = true;
                    vehicleIDPane.Visible = false;
                    break;
                }
}

what can i write in treenode selected and shipment node selected sections of aspx.cs file to hide the panes.

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 05 Sep 2014, 08:17 AM
Hello,

As far as I understand you want to hide the panes on the server. In order to achieve this functionality please use the RadTreeView OnNodeClick server-side event as shown below:
//code behind
protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        if (e.Node.Level == 1)
        {
            SecondPane.Visible = false;
        }
        else if (e.Node.Level == 2)
        {
            ThirdPane.Visible = false;
        }
    }

The Level property of the RadTreeNode object shows the level value of the node in the tree hierarchy. In other word if the level of the node is "0" it meas that this the root node and etc.
In the code snippet above if the clicked node is a first child it will hide the second pane and if it is second child it will hide the third pane. Please note that "SecondPane" and "ThirdPane" are the id values of the RadPane controls inside the RadSplitter.

Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Sudhakar
Top achievements
Rank 1
answered on 05 Sep 2014, 12:01 PM
Hi Dimitrov,

The solution you have given is not working for me.

You have given the solution for server side,but we are doing this in client side.
case:treenode selected and case:shipmentnode selected -->these two are the client side events in aspx.cs file
I think we need to write some thing in these two events.
Please let me know if anything more you required.

Thanks,
Sudhakar.
0
Boyan Dimitrov
Telerik team
answered on 09 Sep 2014, 03:40 PM
Hello Sudhakar,

In order to achieve this functionality on the client side I would suggest the following approach:
   1. Finding the client-side object of the RadPane control you want to hide.For example you can find the client-side object for the Shipment Pane as shown:
//JavaScript
var shipmentPane= $find("<%= ShipmentPane.ClientID %>");

    2. Use the RadPane client-side object set_visible(false) in order to hide the RadPane.
//JavaScript
shipmentPane.set_visible(false);

Hope that this will be helpful.


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Sudhakar
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Sudhakar
Top achievements
Rank 1
Share this question
or