Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
85 views
Hi,

We have an implementation of Telerik navigation for SP 2010. One of the issues that we are having is that the navigation remembers what is expanded from page to page. For example if i expand the 3rd nav element on one page and click on to a different SP site within the same farm the 3rd nav element will be expanded already.
This is also true for selecting a nav element, we have selected as orange and not selected as blue. If i select the 2nd nav link, it goes orange, and go to that linking page the 2nd nav link will already be selected and highlighted in orange, although i havent clicked on the link or navigated to it.

Any help on why this is happening would be appreciated.

Thanks
Stephen
Stephen
Top achievements
Rank 1
 asked on 09 Sep 2014
1 answer
182 views
Hi
We have used dropdowntree with client data source.The control is loading and working fine.But the child nodes without children are also loaded with expand (+) beside, on page load.How to avoid this.

Thanks
Boyan Dimitrov
Telerik team
 answered on 09 Sep 2014
3 answers
108 views
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.
Boyan Dimitrov
Telerik team
 answered on 09 Sep 2014
1 answer
187 views
Hello,

I am trying to export RadEditor content to PDF and save on server. After export (on web preview), most lithuanian characters (ąčęė etc) are shown as #. If I change the font on editor menu to Arial or such, chosen text section gets converted with all characters properly. I only left proper font options for user to select on editor menu, however, problem is that default font is the one that does not work (when clicked on editor area, SelectFont field becomes something like "helvetia...", even though it's not on the font list), and I wish to not allow user use font that does not get converted properly.

What I've tried:
<ExportSettings><Pdf DefaultFontFamily="Arial"/></ExportSettings>   - but this did not affect anything (also tied different font families).

<telerik:EditorCssFile>  - It changed the default editor text style to Arial, but on  PDF after export all this style from css vanishes.

Is there any other way to prohibit user to use non unicode font on RadEditor, or in any other way avoid unsuccessful lithuanian font export attempts to pdf?


Ianko
Telerik team
 answered on 09 Sep 2014
2 answers
94 views
Im looking for a suggestion on how to cause the first node to show expanded.  Im using a WCF service with load-on-demand and that works fine.  Its just that the tree is completely collapsed and id like to cause the 1st level to be shown.  

Ive thought about something like this.  Just look for the root node and cause expand it.
The question then is ...where to do this from?  On page load?  
http://www.telerik.com/help/aspnet-ajax/treeview-client-expand-parent-nodes.html
BitShift
Top achievements
Rank 1
Veteran
 answered on 09 Sep 2014
6 answers
304 views
Hi there,
   I've been testing the framework and I can successfully get values from GetScreenSize(userAgent), but GetScreenDimensions() always gives me 0x0
e.g. http://feniksdev-staging.azurewebsites.net/m/News/heyadamhey/~/12794542/11419166

the above url is using the following in the master page's OnInit event:
public DeviceScreenDimensions screenDimensions;
 
protected override void OnInit(EventArgs e)
{
    screenDimensions = Detector.GetScreenDimensions(Request.UserAgent);
}



in the Page's code behind :
protected void Page_Load(object sender, EventArgs e)
{
    var master = (this.Page.Master as Mobi);
    ScreenWidth = master.screenDimensions.Width;
    ScreenHeight = master.screenDimensions.Height;
    NewsContentFrame.Src = article.URL;
    NewsContentFrame.Attributes.Add("height", ScreenHeight-10 + "px");
    NewsContentFrame.Attributes.Add("width", ScreenWidth-100 + "px");
}

in the aspx:
<p>screen is <%= ScreenWidth%>x<%= ScreenHeight%></p>
<iframe runat="server" id="NewsContentFrame"></iframe>

whether I load the above URL on my pc or phone, I get 
"screen is 0x0"

I got the same result when following the examples here: http://www.telerik.com/help/aspnet-ajax/detection-framework.html


Thanks
Adam
Dimitar
Telerik team
 answered on 09 Sep 2014
1 answer
136 views
I have a Telerik RadGrid which uses the EditFormSettings like this:

    <EditFormSettings EditFormType="WebUserControl" UserControlName="~/UserControls/MyUserControl.ascx" >
        <EditColumn ButtonType="ImageButton" />
    </EditFormSettings>

Within MyUserControl.ascx, I have a button which I'd like to trigger an event handler when clicked. The two ways I know of doing this are as follows:

1.  `OnClick="btnOkay_Click"` as a button attribute, where the event handler is in the code behind
2.  `CommandName="Update"` as a button attribute, where this is handled by the event handler passed into the OnUpdateCommand attribute of the RadGrid

Both of these work. However my problem is that they stop working when the RadGrid is within a user control within a `Repeater` ASP.NET control. In this case, the button event handlers do not get fired (in either of the methods above).

I notice that when I bind my repeater:

    rpt.DataSource = Data
    rpt.DataBind()

If I wrap that in a `if(!Page.IsPostBack)`, then the edit form doesn't appear at all when I click on the RadGrid row's edit link. So I had to remove that `IsPostBack` check. I don't think think this is the cause of my problem, as I've tried explicitly not doing this when clicking my update button (by breaking into the debugger). I just thought I'd mention it incase it was related.

Can anyone think of a reason why this would break in a Repeater?
Dan
Top achievements
Rank 1
 answered on 09 Sep 2014
3 answers
277 views
I am getting a JavaScript exception everytime I close a window containing my Telerik combobox hosting Web page. Looks like Telerik is trying to unregister a 'mousedown' event handler but the object does not have this handler defined.

My ASPX page includes the following scripts:  jquery-1.10.2.js   and jquery-1.10.2.js
My RadScriptManager has the EnableEmbeddedjQuery="false"
I'm using Telerik version 2014.1.403.45

Any suggestions as to why this is happening?

Call stack:
commonScripts._removeHandler [Telerik.Web.UI.WebResource.axd] Line 560 Script
commonScripts.removeHandler [Telerik.Web.UI.WebResource.axd] Line 558 Script
b.RadComboBox.prototype._detachDocumentEvents [Telerik.Web.UI.WebResource.axd] Line 3990 Script
b.RadComboBox.prototype.dispose [Telerik.Web.UI.WebResource.axd] Line 4001 Script
Sys._Application.prototype.dispose [Telerik.Web.UI.WebResource.axd] Line 6 Script
Sys._Application.prototype._unloadHandler [Telerik.Web.UI.WebResource.axd] Line 6 Script
Anonymous function [Telerik.Web.UI.WebResource.axd] Line 6 Script
b [Telerik.Web.UI.WebResource.axd] Line 6 Script

Exception:
Unhandled exception at line 560, column 1 in http://localhost/Fieldpoint.Website/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radGlobalScriptManager_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:5924cf72-83cf-477d-98eb-a608a92942c5:ea597d4b:b25378d2;Telerik.Web.UI:en-US:68d9452f-f268-45b2-8db7-8c3bbf305b8d:16e4e7cd:365331c3:24ee1bba:ed16cbdc:2003d0b8:f46195d3:88144a7a:1e771326:aa288e2d:258f1c72

0x800a138f - JavaScript runtime error: Unable to get property 'mousedown' of undefined or null referenceUnhandled exception at line 560, column 1 in http://localhost/Fieldpoint.Website/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radGlobalScriptManager_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:5924cf72-83cf-477d-98eb-a608a92942c5:ea597d4b:b25378d2;Telerik.Web.UI:en-US:68d9452f-f268-45b2-8db7-8c3bbf305b8d:16e4e7cd:365331c3:24ee1bba:ed16cbdc:2003d0b8:f46195d3:88144a7a:1e771326:aa288e2d:258f1c72

0x800a138f - JavaScript runtime error: Unable to get property 'mousedown' of undefined or null reference
Nencho
Telerik team
 answered on 09 Sep 2014
1 answer
108 views
Telerik.Web.UI.dll, version 2014.1.225.40

using c#

I populate/bind my treeView using the DataSource property. When changes are made on the client, I use trackChanges / commitChanges per documentation. 

Upon postback to the server, how do I identify all changes made in the treeview control? Is there a built-in way to enumerate just changed nodes, then discern between which nodes need to be added, updated, deleted? I've seen lots of documentation on the importance of using trackChanges / commitChanges, but not much on what to do after that.

Thanks for any direction

Boyan Dimitrov
Telerik team
 answered on 09 Sep 2014
5 answers
289 views

Hi,

I'm doing some tests on a project with a iPad  with iOS5 and a iPad with iOS6, and I have some troubles with RadListBox.

First, when I scroll, it is lagging, a lot. On my desktop, everything run smoothly, without lag, but the same RadListbox on a iPad is just horrible.

Also, even if I scroll down at the middle of the list, I will be automatically redirect to the selectionned item, and it's so fast that I don't have the time to select another item. 

I've seen that when Telerik detect a touch screen, the class RadTouchExtender is assigned to every RadListBox in my project. Also, the style "overflow:hidden;" is added to the div.

My question is: Can I disable this detection, with a property on the ListBox, server-side or cliend-side or just at the loading of the project? 

The RadListBox use ItemTemplate to display items. Here an exemple:

<telerik:RadListBox ID="lbxPatDisponibles" PersistClientChanges="true" 
        runat="server" Height="300px" Width="335px" Visible="true" 
        TransferToID="lbxTraites" DataValueField="noauto" >
    <ItemTemplate>
        <div class="listeDispo patientTraite">
            <div class="dispoBouton" onclick="transfertPatient(<%# Eval("noauto") %>, false);">
                <img class="adminButton" src="Images/add.gif" alt="Add" height="32" style="padding:10px 0px;" />
            </div>
            <div class="dispoInfo">
                <div class="cboContent" style="display:block;">
                    <span style="font-weight: bold;">
                        <%#DataBinder.Eval(Container, "Attributes['enteteItem']")%>
                        <span style="font-size: 10px;">
                            <br /><%#DataBinder.Eval(Container, "Attributes['detailItem']")%>
                        </span>
                    </span>
                </div>
            </div>
        </div>
    </ItemTemplate>
</telerik:RadListBox>
 

Thank you

Visual studio 2008 .NET 3.5 SP1
Windows 7
Trouble with iOS browser (I can't test on a Android device, so I can't say if it's for every touch screen device)
Telerik ASP.NET AJAX 2012.1.301.2
VB.NET

Dimitar
Telerik team
 answered on 09 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?