Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
90 views
Hi there,

I have added a RadDock to RadDockZone1 dynamically from code behind, then drag the RadDock to RadDockZone2, the docks count in RadDockZone2 still shows 0 (
RadDockZone2.Docks.Count). However, if I drag a static dock from RadDockZone1 to RadDockZone2, the dock count number in RadDockZone2 is correct. Please see the following code for details (RadDockTest.aspx and RadDockTest.aspx.cs). Any help is much appreciated. Thank you.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadDockTest.aspx.cs" Inherits="RadDockTest" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<head id="Head1" runat="server"
    <title>ASP.NET Dock Demo - AutoPostBack</title
     <!--[if lte IE 6]> 
     <style type="text/css"
     .raddockzone{height:250px} 
     </style
     <![endif]-->
     <style type="text/css"
          .qsfConsole { 
               margin-top: 19px; 
          
     </style
</head
<body
    <form id="form1" runat="server"
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> 
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" /> 
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" /> 
     <telerik:RadDockLayout runat="server" ID="RadDockLayout1"
          <table
               <tr
                    <td style="vertical-align: top"
                         Docking Zone 1<br /> 
                         <br /> 
                         <telerik:RadDockZone runat="server" ID="RadDockZone1" Width="270px" MinHeight="360px"
                              <telerik:RadDock runat="server" ID="RadDock1" Title="AutoPostBack enabled" 
                                   EnableRoundedCorners="true"
                                   <ContentTemplate
                                        This RadDock control will initiate postback when it is moved around the page. You 
                                        could create AsyncPostbackTrigger to replace the postback with an AJAX call. 
                                   </ContentTemplate
                              </telerik:RadDock
                              <telerik:RadDock runat="server" ID="RadDock2" Title="AutoPostBack disabled"
                                   EnableRoundedCorners="true"
                                   <ContentTemplate
                                        This RadDock control will NOT initiate postback when it is moved around the page. 
                                        However, if you post back the page using another control, the DockPositionChanged 
                                        event will be fired. 
                                   </ContentTemplate
                              </telerik:RadDock
                         </telerik:RadDockZone
                    </td
                    <td style="vertical-align: top"
                         Docking Zone 2<br /> 
                         <br /> 
                         <telerik:RadDockZone runat="server" ID="RadDockZone2" Width="270px" MinHeight="360px"
                         </telerik:RadDockZone
                    </td
               </tr
          </table
     </telerik:RadDockLayout>
     <asp:Button ID="bt_SaveCustomInterfaces" runat="server" Text ="Save Interface" OnClick="bt_SaveCustomInterfaces_Click" />
    </form
</body
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI; 
  
  
public partial class RadDockTest : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RadDock dock = CreateRadDock();
        RadDockZone1.Controls.Add(dock); 
    }
  
    protected void bt_SaveCustomInterfaces_Click(object sender, EventArgs e)
    {
        if (RadDockZone2.Docks.Count == 1)
        {
            foreach (RadDock _radDock in RadDockZone2.Docks)
            {
            }
        }
    }
  
    private RadDock CreateRadDock()
    {
        RadDock dock = new RadDock();
        dock.DockMode = DockMode.Docked;
        dock.UniqueName = Guid.NewGuid().ToString().Replace("-", "a");
        dock.ID = string.Format("RadDock{0}", dock.UniqueName);
        dock.Title = "Dock";
        dock.Text = string.Format("Added at {0}", DateTime.Now);
        dock.Width = Unit.Pixel(300);
  
        dock.Commands.Add(new DockCloseCommand());
        dock.Commands.Add(new DockExpandCollapseCommand());
  
        return dock;
    }
}
Meng
Top achievements
Rank 1
 answered on 09 Sep 2014
1 answer
64 views
I have a radgrid that is entirely created programatically and I'm trying to add a GridCheckBoxColumn.  I want the checkboxes to be editable upon load but they are stuck in read only mode.  I can't figure out how to make them checkable. 

ASPX:
<asp:PlaceHolder ID="phRadGrids" runat="server" />

C#:
RadGrid newGrid = new RadGrid();
newGrid.ID = "grdTesting";
newGrid.MasterTableView.AutoGenerateColumns = false;
 
GridCheckBoxColumn col_Assign = new GridCheckBoxColumn();
col_Assign.HeaderText = "Assign";
col_Assign.UniqueName = "Assign";
newGrid.MasterTableView.Columns.Add(col_Assign);
 
phRadGrids.Controls.Add(newGrid);

The checkbox column shows up fine but it's greyed out and cannot be checked.  Is there an easy way to push this into an editable mode on load?
Keith
Top achievements
Rank 1
 answered on 09 Sep 2014
1 answer
155 views
Hi Everyone,

I was following this Demo and run into a problem.  In the Web User Control(ascx) page, I need to Evaluate the CheckBox when editing a record.  When I click on Edit, it work great but when I click on "Add new record", I'm getting this error:

Error: Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.

This is coming from the Checked function. Below is my coding.

<asp:CheckBox ID="chkbxReadOnly" runat="server"
              Checked='<%# DataBinder.Eval(Container, "DataItem.ReadOnly") %>'
             AutoPostBack="True" />

Can someone help me so  ignore the Checked function when I try to insert a record or modify the above Checked code?
Anthony
Top achievements
Rank 1
 answered on 09 Sep 2014
0 answers
71 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
152 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
69 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
134 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
49 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
268 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
120 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?