Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
651 views
Hello,
We are using grid in our project and we are faced to an important issue. There are 3 options to export the data displayed on the grid such as Excel, Pdf, and Word. Excel and Word work just fine both there is a problem with exporting to pdf. When we search the log files we came across that there are invalid characters in the data. But these characters are Ok for office to omit them. I saw a similar question in the forum (this), that solution is not acceptable in our standards and will cause performance issues. The other point is that the solution is only focusing on just specific part of the program. In our case we know one parameter but there will be same or different character at the different part of the program. Here is the exception we caught;
Exception information:
Exception type: GridPdfExportException
Exception message: Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.
Parse error:
' ', hexadecimal value 0x1A, is an invalid character. Line 883, position 199.

Do you have a solution for this kind of error?
Thanks,
Ertan
Kostadin
Telerik team
 answered on 10 Sep 2014
1 answer
106 views
Hi
I'm new to Telerik RadGrid and it's databinding. I'm trying to use the ADO.NET Data Service binding but I need to pass parameter. I'm using the sample code but I need to modify it a little bit.

In a perfect world I would add an ID="dbAdoDataService" and runat="server" to the <DataBinding .... > and then in code behind I could use something like dbAdoDataService.SelectParameter = Convert.ToInt32(Request.QueryString["ProductID"]);. But it's not possible to add runat="server" or add an ID to the DataBinding so what can I do to select the rows I want at runtime? And I'm not sure how to modify the GridAdoNetDataService.cs. Please help me I'm stuck.  (Hope you understand my bad english).

Here is the samplecode from Telerik support site:

This is the binding code (Default.aspx):

1.<ClientSettings>
2.    <DataBinding Location="GridAdoNetDataService.svc" SelectCountMethod="GetCount">
3.        <DataService TableName="ReadOnlyProducts" />
4.    </DataBinding>
5.</ClientSettings>

And here is the GridAdoNetDataService.cs:

01.public class GridAdoNetDataService : DataService<NorthwindEntities>
02.{  
03.    public static void InitializeService(IDataServiceConfiguration config)
04.    {      
05.         config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
06.         config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
07.    }
08.  
09.    [WebGet]
10.    public int GetCount(string where)
11.    {
12.        return String.IsNullOrEmpty(where) ? CurrentDataSource.ReadOnlyProducts.Count() :
13.            CurrentDataSource.ReadOnlyProducts.Where(where).Count();
14.    }
15.  
16.}

Kostadin
Telerik team
 answered on 10 Sep 2014
6 answers
448 views

I like the ability to select a row just by clicking anywhere on it, but I don't know how to run a server-side event when it happens. 

Does anyone have an example of how to run a server-side event after clicking anywhere on a row in a RadGrid?  I don't really have room for a select button, so I'm looking for other options.
John
Top achievements
Rank 1
 answered on 09 Sep 2014
3 answers
159 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
88 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
213 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
88 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
189 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
116 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
205 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?