Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
368 views
I'm trying to pad the text of a RadComboBoxItem with spaces (to create a sense of hierarchy).  This works fine with a regular HTML select control:

<select>
    <option>Item 1</option>
    <option>&nbsp;&nbsp;Item 1.1</option>
    <option>&nbsp;&nbsp;Item 1.2</option>
    <option>Item 2</option>
    <option>&nbsp;&nbsp;Item 2.1</option>
    <option>&nbsp;&nbsp;&nbsp;&nbsp;Item 2.1.1</option>
    <option>&nbsp;&nbsp;&nbsp;&nbsp;Item 2.1.2</option>
    <option>Item 3</option>
    <option>&nbsp;&nbsp;Item 3.1</option>
    <option>&nbsp;&nbsp;Item 3.2</option>
</select>

However, when I try to set the text property of a RadComboBoxItem using html entities (&nbsp;), the control seems to be escaping the characters so it shows up exactly as typed instead of showing up as an actual space:item.Text = padding + asset.AssetName;

string padding = "";
for(int i = 0; i < depth; i++)
    padding += " ";
RadComboBoxItem item = new RadComboBoxItem();
item.Value = asset.AssetID.ToString();
item.Text = padding + asset.AssetName;
item.Enabled = (asset.Type == AssetType.AppSet);
item.Selected = (asset.AssetID == ParentAssetID);
rcb.Items.Add(item);

Any ideas about how to prevent the RadComboBox from escaping HTML entities?
Nencho
Telerik team
 answered on 02 Jan 2015
1 answer
97 views
I'm using a radwindow to open a popup, now there was requirement to add new links in the titlebar. From what I found, I used this javascript snippet:-
HereI'm inserting two new TDs just before default close button. The TD before that is what contains an TD>> EM for title text of radwindow.
function openPopUpWindow(Url, name) {
    var win = window.radopen(Url, name);
    winRad1 = win;
    var TitleBar = win.GetTitlebar();
    var parent = TitleBar.parentNode;
    var oUL = parent.getElementsByTagName('TR')[0];  
    secondTD = oUL.getElementsByTagName('TD')[1];
    innerEm = oUL.getElementsByTagName('EM')[0];   // This is where I want to change width
    innerEm.id = 'TitleRadEM';                   // Assign an ID to it; Can't chnage it's width here as before load it's empty
    elementThis = innerEm;
    win.add_pageLoad(OnClientPageLoad12);
    win.add_activate(OnClientActivate12);
    win.add_resizeEnd(OnClientResizeEnd12);
    if (!(oUL.firstChild.id == "helplink")) {
        var oLI = document.createElement("TD");
        oLI.id = "helplink"
        oLI.style.cssText = 'width:22px;';
        var Em = document.createElement("EM");
        var EmClose = document.createElement("EM");
        var A = document.createElement("A");
        oLI.appendChild(Em);
        A.className = "helplinclass";
        A.href = "https://support.xyzxyzxyz.com/";
        A.target = "_blank";
        A.title = "Help";
        A.id = 'HelpLink';
        A.innerHTML = 'Help';
        Em.appendChild(A);
        oUL.insertBefore(oLI, oUL.lastChild);
        var oLI2 = document.createElement("TD");
        oLI2.style.cssText = 'width:22px;';
        oLI2.appendChild(EmClose);
        EmClose.unselectable = 'on';
        EmClose.innerHTML = '  Close';
        EmClose.style["font-size"] = "10pt";
        EmClose.style.cssText = 'font-size:10pt; padding-right:-1px;';
        oUL.insertBefore(oLI2, oUL.lastChild);
        win._updateTitleWidth();
    }
    win.center();
    win.autoSize(false); // tried with true and without this as well
}
function OnClientPageLoad12() {
    var windowR = GetRadWindowManager();
    if (winRad1 != null) {
        var win = winRad1;
        var TitleBar = win.GetTitlebar();
        var parent = TitleBar.parentNode;
        var oUL = parent.getElementsByTagName('TR')[0];
        secondTD = oUL.getElementsByTagName('TD')[1];
        innerEm = oUL.getElementsByTagName('EM')[0];
        innerEm.style.cssText = 'width:850px;';
        win._updateTitleWidth();
    }
 
}
 
function OnClientActivate12() {
    document.getElementById('TitleRadEM').style.cssText = 'width:850px;';
    elementThis.style.cssText = 'width:850px;';
}


The problem is that as the rad window is loaded the UI gets a bit distorted at right hand side of radwindow.
As I've inserted a new elements (2 tds); original width changes and this causes the width to overflow at RHS. Now to correct this I tried changing width of title TD (containing the text just before the Help link) of the titlebar but this is not working. 
I bind a loadevent as well activate event in the above code:-
Therefore I try to reduce the width of TD containing the title text so that new links can be accomodated. To achieve this I biI bind a loadevent as well activate event in the above code:-
In OnClientPageLoad12 at first the width is adjusted and then after telerk's js is executed it again get's distorted.
In OnClientActivate12: the width is adjusted just the right way but I've to click on radwindow to activate it.

FYI: I've used both approaches, that is accessing element through document.getElementby and from radwindowmanager.


Please help me to move in the right direction.
Rahul
Top achievements
Rank 1
 answered on 02 Jan 2015
2 answers
156 views
Hi Telerik,

I have a bizarre bug where RadScheduler won't properly wrap a multi-day appointment to the next week for some time zones in the month of November.  I've created a sample project that reproduces the issue.  I haven't gone thru the trouble of mapping out which time zones break the control, but more than a few do in my experimentation.  There are two Appointments - you can see the November appointment doesn't wrap when using "Pacific Standard Time", but the December appoint does wrap properly.  If you change the time zone to "US Mountain Standard Time", then everything works as expected.

Here's the Default.aspx.cs:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace SchedulerBug
{
    public partial class Default : System.Web.UI.Page
    {
        class ATGAppointment
        {
            public int AppointmentId { get; set; }
            public string Subject { get; set; }
            public DateTime Start { get; set; }
            public DateTime End { get; set; }
        }
 
        private List<ATGAppointment> Appointments = new List<ATGAppointment>()
        {
            new ATGAppointment()
            {
                AppointmentId = 1,
                Subject = "Some multi-day appointment from 11/4/14 to 11/28/14",
                Start = new DateTime(2014, 11, 4, 0, 0, 0),
                End = new DateTime(2014, 11, 28, 11, 59, 0)
            },
            new ATGAppointment()
            {
                AppointmentId = 2,
                Subject = "Some multi-day appointment from 12/10/14 to 12/28/14",
                Start = new DateTime(2014, 12, 10, 0, 0, 0),
                End = new DateTime(2014, 12, 28, 11, 59, 0)
            }
        };
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                RadScheduler1.DataSource = this.Appointments;
                RadScheduler1.DataBind();
 
                RadScheduler1.SelectedDate = new DateTime(2014, 11, 1);
 
                // Doesn't wrap in November month view
                RadScheduler1.TimeZoneID = "Pacific Standard Time";
 
                // Wraps when set to this time zone
                //RadScheduler1.TimeZoneID = "US Mountain Standard Time";
            }
        }
    }
}


And the corresponding Default.aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SchedulerBug.Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div>
            <telerik:RadScheduler ID="RadScheduler1" runat="server" Width="850px" Height="100%"
                DataKeyField="AppointmentId"
                DataSubjectField="Subject"
                DataStartField="Start"
                DataEndField="End"
                SelectedView="MonthView">
            </telerik:RadScheduler>
        </div>
    </form>
</body>
</html>

I am using Telerik UI for ASP.NET AJAX 2014 Q3.

Is this a known issue, and do you know of any work-arounds for this?

Thanks,
Mike Kolbly
 





Plamen
Telerik team
 answered on 02 Jan 2015
1 answer
77 views
Is there any way to get ID of selected task.

I have seen that there is no event on selection of task.
Nencho
Telerik team
 answered on 02 Jan 2015
1 answer
248 views
I have following RadGantt chart it is not showing parent child hierarchy properly. it is creating hierarchy but displaying same as parent.

<
telerik:RadGantt runat="server" ID="RadGantt1"
                            SnapToGrid="false"
                            OnDependencyInsert="RadGantt1_DependencyInsert"
                            OnDependencyDelete="RadGantt1_DependencyDelete"
                            OnTaskDelete="RadGantt1_TaskDelete"
                            OnTaskUpdate="RadGantt1_TaskUpdate"
                            OnTaskInsert="RadGantt1_TaskInsert" SelectedView="WeekView" AutoGenerateColumns="false"
                            OnPreRender="RadGantt1_PreRender">
                            <YearView UserSelectable="true" />
                            <Columns>
                                <telerik:GanttBoundColumn DataField="Title"></telerik:GanttBoundColumn>
                                <telerik:GanttBoundColumn DataField="Start"></telerik:GanttBoundColumn>
                                <telerik:GanttBoundColumn DataField="End"></telerik:GanttBoundColumn>
                                <telerik:GanttBoundColumn DataField="Duration" DataType="DateTime" HeaderText="Duration" DataFormatString="{0:HH\:MM\:SS}"></telerik:GanttBoundColumn>
                            </Columns>
                            <DataBindings>
                                <TasksDataBindings IdField="ID" TitleField="Title" StartField="Start" EndField="End"
                                    PercentCompleteField="PercentComplete" OrderIdField="OrderID" SummaryField="Summary" ParentIdField="ParentID" />
                                <DependenciesDataBindings IdField="ID" PredecessorIdField="PredecessorID"
                                    SuccessorIdField="SuccessorID" TypeField="Type" />
                            </DataBindings>
                        </telerik:RadGantt>



while (reader.Read())
                    {
                        Task t = new Task();
 
                        t.ID = reader.GetValue(0);
                        t.Title = reader.GetString(1);
                        t.Start = reader.GetDateTime(2);
                        t.End = reader.GetDateTime(3);
                        t.PercentComplete = decimal.Parse(reader.GetValue(4).ToString());
                        t.OrderID=1;
                        t.ParentID = reader.GetValue(5);
                        sessionTasks.Add(t);
                    }
RadGantt1.DataSource = Tasks;
           RadGantt1.DependenciesDataSource = Dependencies;


Nencho
Telerik team
 answered on 02 Jan 2015
3 answers
103 views
I written some client side code that edits the Item Collection of a RadDropDownList.
The problem is that when I do a postback, the serverside only detects the original list.

I don't see what I've done wrong.
This is what I have so far:
var ddl = $find("<%=_ddlLidsIndicators.ClientID%>");
ddl.get_items().clear();
 
var selectItem = new Telerik.Web.UI.DropDownListItem();
selectItem.set_text("Select...");
ddl.get_items().add(selectItem);
 
$.each(data, function (index, value) {
    var newItem = new Telerik.Web.UI.DropDownListItem();
    newItem.set_text(value);
    newItem.set_value(index);
    ddl.get_items().add(newItem);
});
 
var otherItem = new Telerik.Web.UI.DropDownListItem();
otherItem.set_text("Other");
ddl.get_items().add(otherItem);
 
ddl.commitChanges();

 

Plamen
Telerik team
 answered on 02 Jan 2015
4 answers
344 views
Hi
I there Any Way tO use RadControls with Shamsi Date (jalali date ) ????
Plamen
Telerik team
 answered on 02 Jan 2015
5 answers
444 views
Hello, 

I am developing a RadMenu similar to the one from this demo: http://demos.telerik.com/aspnet-ajax/menu/examples/functionality/templates/defaultcs.aspx.

I would like to know how to bind that menu programmatically from C# Code. I need to load menu from database and couldn't find out how to do that. I also need to have thumbnail image for each parent menu same as from that demo. If there is any sample code available, please let me know. Currently, I am populating the menu manually and you can see the sample code below.

<telerik:RadMenu runat="server" ID="RadMenu1" Skin="Glow" Width="100%" Visible="false"
    OnItemClick="RadMenu1_ItemClick">
    <DefaultGroupSettings Height="270px" />
    <Items>
        <telerik:RadMenuItem Text="Home" NavigateUrl="Dashboard.aspx">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Configuration">
            <ContentTemplate>
                <telerik:RadSiteMap runat="server" ID="RadSiteMap1" Skin="Glow" CssClass="itemContent configuration">
                    <DefaultLevelSettings ListLayout-RepeatColumns="3"></DefaultLevelSettings>
                    <Nodes>
                        <telerik:RadSiteMapNode Text="General Settings" NavigateUrl="GeneralSetting.aspx"></telerik:RadSiteMapNode>
                        <telerik:RadSiteMapNode Text="Network Configuration" NavigateUrl="NetworkConfigs.aspx"></telerik:RadSiteMapNode>
                        <telerik:RadSiteMapNode Text="Security Cameras" NavigateUrl="SecurityCameras.aspx"></telerik:RadSiteMapNode>
                    </Nodes>
                </telerik:RadSiteMap>
            </ContentTemplate>
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Administration">
            <ContentTemplate>
                <telerik:RadSiteMap runat="server" ID="RadSiteMap2" Skin="Glow" CssClass="itemContent administration">
                    <DefaultLevelSettings ListLayout-RepeatColumns="3"></DefaultLevelSettings>
                    <Nodes>
                        <telerik:RadSiteMapNode Text="Admin Menu 1" NavigateUrl="AdminMenu1.aspx"></telerik:RadSiteMapNode>
                        <telerik:RadSiteMapNode Text="Admin Menu 2" NavigateUrl="AdminMenu2.aspx"></telerik:RadSiteMapNode>
                        <telerik:RadSiteMapNode Text="Admin Menu 3" NavigateUrl="AdminMenu3.aspx"></telerik:RadSiteMapNode>
                    </Nodes>
                </telerik:RadSiteMap>
            </ContentTemplate>
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Setup">
            <ContentTemplate>
                <telerik:RadSiteMap runat="server" ID="RadSiteMap3" Skin="Glow" CssClass="itemContent setup">
                    <DefaultLevelSettings ListLayout-RepeatColumns="3"></DefaultLevelSettings>
                    <Nodes>
                        <telerik:RadSiteMapNode Text="Setup Menu 1" NavigateUrl="Setup1.aspx"></telerik:RadSiteMapNode>
                        <telerik:RadSiteMapNode Text="Setup Menu 2" NavigateUrl="Setup2.aspx"></telerik:RadSiteMapNode>
                        <telerik:RadSiteMapNode Text="Setup Menu 3"></telerik:RadSiteMapNode>
                        <telerik:RadSiteMapNode Text="Setup Menu 4" NavigateUrl="Setup4.aspx"></telerik:RadSiteMapNode>
                    </Nodes>
                </telerik:RadSiteMap>
            </ContentTemplate>
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Logout" CssClass="menu-logout" Value="logout">
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>


Thanks in advanced,
Robin
Robin
Top achievements
Rank 2
 answered on 02 Jan 2015
8 answers
290 views
I am evaluating RadGrid control. I am having two issues in the evaluation

1. Cascade dropdown loading

There is one ASP dropdownlist for "Project" selection in asp.net page. Once I select the Project from dropdownlist binding the related data in RADGRID in Batchedit mode. In that one column "Module"  RadDropdownlist is populated in grid prerender event. In another column "SubModule" RadDropdownlist is there.
I want that, if I change the Module dropdown, the "SubModule should be populated. Each row may have different module, so each row submodule should be different. RadDropdownlists are in Edittemplatecolumn
How to achieve this? Can you please share the code.

2. I am using RADTextbox in the same grid for "Description" column. If type text and want to give carriage return by pressing enter key. When I press Enter key the focus is lost from the control. I want to type the text with carriage return in this text box. How to achieve this?

Please help me with code samples.

Thanks in advance


Konstantin Dikov
Telerik team
 answered on 01 Jan 2015
1 answer
116 views
Hi Team,

I have a grid with some rows in it. When I expand each row I am displaying the 3 tabs.
I wanted to implement the following scenario.

1)Based on some predefined values(we defining them in enumerations.cs file)need to select the one of the tab by default.
If the enum value is zero need to make the  second tab selected by default and if the enum value is 1 need to make the third tab selected by default.

I am using the telerik dll version of 2014.3.1216.45 and implementing batch editing functionality.

ASPX CODE
-----------------
<telerik:RadGrid ID="DischargeRadGrid"   OnItemDataBound="DsichargeRadGridFormat_OnItemDataBound" runat="server" AutoGenerateColumns="false"
                            CssClass="TransferGridPanel" Height="363px" Width="548px" OnItemCommand="DischargeRadGrid_ItemCommand"
                            OnBatchEditCommand="DischargeRadGrid_BatchEditCommand" OnNeedDataSource="DischargeRadGrid_NeedDataSource" OnPreRender="DischargeRadGrid_PreRender" OnItemCreated="DischargeRadGrid_ItemCreated">
                           <MasterTableView ShowHeadersWhenNoRecords="true" CommandItemDisplay="Top" EditMode="Batch"  HierarchyLoadMode="ServerOnDemand" DataKeyNames="Discharge_ID">
                            <CommandItemSettings ShowRefreshButton="false" AddNewRecordText="Add NewDelivery" />
                               <BatchEditingSettings EditType="Cell" />
                            <NestedViewTemplate>
                             <telerik:RadTabStrip runat="server" ID="DischargeTabStrip" MultiPageID="DischargeMultipage" ClickSelectedTab="True"
                                 SelectedIndex="0" OnTabClick="DischargeTabStip_TabClick">
                        <Tabs>
                            <telerik:RadTab runat="server" Text="Details" PageViewID="DischargePageViewDetails">
                            </telerik:RadTab>
                            <telerik:RadTab runat="server" Text="Compartments" PageViewID="DischargePageViewCompartments">
                            </telerik:RadTab>
                            <telerik:RadTab runat="server" Text="Products" PageViewID="DischargePageViewProducts">
                            </telerik:RadTab>
                        </Tabs>
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage runat="server" ID="DischargeMultipage" SelectedIndex="0" RenderSelectedPageOnly="false">
                        <telerik:RadPageView runat="server" ID="DischargePageViewDetails">
                            <div class="contactWrap">
                                <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                            <asp:Label runat="server" ID="lbl_ShipTo" Text='ShipTo:' Font-Bold="true"></asp:Label></td>
                                    <td>
                                            <asp:TextBox runat="server" ID="txt_ShipToValue" Enabled="false"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                    <td>
                                            <asp:Label runat="server" ID="lbl_SiteName" Text='Name:' Font-Bold="true"></asp:Label></td>
                                    <td>
                                            <asp:TextBox runat="server" ID="txt_SiteNameValue" Enabled="false"></asp:TextBox></td>
                                </tr>
                                <tr>
                                    <td>
                                            <asp:Label runat="server" ID="lbl_Address" Text='Address:' Font-Bold="true"></asp:Label></td>
                                    <td>
                                            <asp:TextBox runat="server" ID="txt_AddressValue" Enabled="false" TextMode="MultiLine"></asp:TextBox></td>
                                    </tr>                                    <tr>
                                    <td>
                                            <asp:Label runat="server" ID="lbl_SplInstruction" Text='SpecialInstructions:' Font-Bold="true"></asp:Label></td>
                                    <td>
                                            <asp:TextBox runat="server" ID="txt_SplInstructionValue" Enabled="false"></asp:TextBox></td>
                                    </tr>                                    <tr>
                                    <td>
                                            <asp:Label runat="server" ID="lbl_PONumber" Text='PONumber:' Font-Bold="true"></asp:Label></td>
                                    <td>
                                            <asp:TextBox runat="server" ID="txt_PONumberValue"  Enabled="false"></asp:TextBox>
                                            <asp:ImageButton ImageUrl="~/images/PenEditIcon.gif" runat="server" ID="btn_editPONumber"  OnClick="btn_editPONumber_Click"></asp:ImageButton>                                    </td>
                                </tr>
                                 
                                   
                            </table>
                            </div>
                        </telerik:RadPageView>
                        <telerik:RadPageView runat="server" ID="DischargePageViewCompartments">
                            <telerik:RadGrid ID="CompartmentLevelDischargeRadGrid" runat="server" AutoGenerateColumns="false"
                                CssClass="TransferGridPanel" Height="233px" Width="475px" OnItemDataBound="CompartmentLevelDischargeRadGrid_ItemDataBound" 
                                OnBatchEditCommand="CompartmentLevelDischargeRadGrid_BatchEditCommand" OnNeedDataSource="CompartmentLevelDischargeRadGrid_NeedDataSource"
                                 OnPreRender="CompartmentLevelDischargeRadGrid_PreRender">
                               
                                <MasterTableView ShowHeadersWhenNoRecords="true" CommandItemDisplay="Top" EditMode="Batch" DataKeyNames="CompartmentIndex">
                                    <CommandItemSettings ShowRefreshButton="false" AddNewRecordText="Add LineItem" />
                               <BatchEditingSettings EditType="Cell" />
                                    <Columns>
                                        <telerik:GridTemplateColumn HeaderText="Comp No." HeaderStyle-Width="50px" UniqueName="ItemNo" DataField="CompartmentIndex">
                                            <ItemTemplate>
                                                <%# Eval("CompartmentIndex") %>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <telerik:RadComboBox runat="server" ID="ddlDischargeCompartment" OnLoad="ddlDischargeCompartments" Width="50px">
                                                </telerik:RadComboBox>
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="Planned Product" HeaderStyle-Width="70px" UniqueName="PlannedDischargeProd" DataField="PlannedProductName" ReadOnly="true" InsertVisiblityMode="AlwaysVisible">
                                            <ItemTemplate>
                                                <%# Eval("PlannedProductName") %>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <telerik:RadComboBox runat="server" ID="ddlPlannedDischargeProduct" OnLoad="ddlPlannedProductDischarge" Width="70px">
                                                </telerik:RadComboBox>
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="Actual Product" HeaderStyle-Width="70px" UniqueName="ActualDischargeProd" DataField="ActualProductName">
                                            <ItemTemplate>
                                                <%# Eval("ActualProductName") %>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <telerik:RadComboBox runat="server" ID="ddlActualDischargeProduct" OnLoad="ddlActualProductDischarge" Width="70px">
                                                </telerik:RadComboBox>
                                            </EditItemTemplate>
                                        </telerik:GridTemplateColumn>
                                       
                                                        <telerik:GridTemplateColumn HeaderText="Planned Quantity" HeaderStyle-Width="50px" UniqueName="PlannedDischargeQty" DataField="PlannedQuantity" ReadOnly="true" InsertVisiblityMode="AlwaysVisible">
                                                            <ItemTemplate>
                                                                <%# Eval("PlannedQuantity") %>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                               <telerik:RadTextBox ID="plannedDischargeQty" runat="server" DataField="PlannedQuantity" HeaderStyle-Width="30px" HeaderText="Planned Quantity" UniqueName="PlannedDischargeQty">
                                                             </telerik:RadTextBox>
                                                            </EditItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn HeaderText="Actual Quantity" HeaderStyle-Width="50px" UniqueName="ActualDischargeQty" DataField="ActualQuantity">
                                                            <ItemTemplate>
                                                                <%# Eval("ActualQuantity") %>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                               <telerik:RadTextBox  ID="ActualDischargeQty" runat="server"  DataField="ActualQuantity" HeaderStyle-Width="30px" HeaderText="Actual Quantity" UniqueName="ActualDischargeQty">
                                                             </telerik:RadTextBox>
                                                            </EditItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                       
                                        <telerik:GridTemplateColumn HeaderText="Planned Tank" HeaderStyle-Width="50px" UniqueName="PlannedTank" DataField="TankIndex" ReadOnly="true" InsertVisiblityMode="AlwaysVisible">
                                                            <ItemTemplate>
                                                                <%# Eval("TankIndex") %>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                               <telerik:RadTextBox runat="server" ID="plannedTank"  DataField="TankIndex" HeaderStyle-Width="30px" HeaderText="Planned Tank" UniqueName="PlannedTank">
                                                               </telerik:RadTextBox>
                                                            </EditItemTemplate>
                                           
                                       
                                                        </telerik:GridTemplateColumn>
                                       
                                        <telerik:GridTemplateColumn HeaderText="Actual Tank" HeaderStyle-Width="50px" UniqueName="ActualTank" DataField="ActualTankIndex">
                                                            <ItemTemplate>
                                                                <%# Eval("ActualTankIndex") %>
                                                            </ItemTemplate>
                                                            <EditItemTemplate>
                                                               <telerik:RadTextBox runat="server" ID="actualTank" DataField="ActualTankIndex" HeaderStyle-Width="30px" HeaderText="Actual Tank" UniqueName="ActualTank">
                                                             </telerik:RadTextBox>
                                                            </EditItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn UniqueName="LeftOnBoard" DataField="LOB" HeaderText="LOB" ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Adjustment" DataField="Adjustment" HeaderText="Adjustment" ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </telerik:RadPageView>
                    <telerik:RadPageView runat="server" ID="DischargePageViewProducts">
                    <telerik:RadGrid ID="ProductLevelDischargeRadGrid" runat="server" AutoGenerateColumns="false"
                                CssClass="TransferGridPanel" Height="233px" Width="475px" OnItemDataBound="ProductLevelDischargeRadGrid_ItemDataBound"
                          OnNeedDataSource="ProductLevelDischargeRadGrid_NeedDataSource">
                            <MasterTableView ShowHeadersWhenNoRecords="true">
                                <Columns>
                                    <telerik:GridBoundColumn UniqueName="PlannedDischargeProd" DataField="PlannedProductName" HeaderText="Planned Product" Visible="false">
                                        </telerik:GridBoundColumn>                                       
                                        <telerik:GridBoundColumn UniqueName="ActualDischargeProd" DataField="ActualProductName" HeaderText="Actual Product">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PlannedDischargeQty" DataField="PlannedQuantity" HeaderText="Planned Quantity">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="ActualDischargeQty" DataField="ActualQuantity" HeaderText="Actual Quantity">
                                        </telerik:GridBoundColumn>                                       
                                        <telerik:GridBoundColumn UniqueName="ActualTank" DataField="ActualTankIndex" HeaderText="Actual Tank">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="CaluculatedDifference" DataField="CaluculatedDifference" HeaderText="Caluculated Difference">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PreDip" DataField="PreDip" HeaderText="PreDip">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PostDip" DataField="PostDip" HeaderText="PostDip">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PreSMR" DataField="PreSMR" HeaderText="SMR Start">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PostSMR" DataField="PostSMR" HeaderText="SMR End">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="LeftOnBoard" DataField="LOB" HeaderText="LOB">
                                    </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Adjustment" DataField="Adjustment" HeaderText="Adjustment">
                                    </telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                    </telerik:RadPageView>
                    </telerik:RadMultiPage>
                    </NestedViewTemplate>                                <Columns>
                                    <telerik:GridBoundColumn  UniqueName="DeliveryNo" DataField="Discharge_ID">
                                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">                               
                                            </RequiredFieldValidator>
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  UniqueName="ShipTo"
                                        DataField="Site_ID">
                                        <ColumnValidationSettings EnableRequiredFieldValidation="true">
                                            <RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">                               
                                            </RequiredFieldValidator>
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  UniqueName="ShipToName"
                                        DataField="SiteAddress" ReadOnly="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  UniqueName="DischargeStart"
                                        DataField="DischargeStartTime" ReadOnly="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  UniqueName="DischargeEnd"
                                        DataField="DischargeEndTime" ReadOnly="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn  UniqueName="PlannedFlag"
                                        DataField="Planned" Display="false">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings>                           
                           
                            <Scrolling AllowScroll="true"/>
                              <ClientEvents OnBatchEditOpened="OnBatchEditOpened" /> 
                            </ClientSettings>
                        </telerik:RadGrid>
ASPX.CS CODE
------------ protected void DischargeRadGrid_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            dischargeID = Convert.ToInt64(item["DeliveryNo"].Text);
            Session[_selectDischargeId] = dischargeID;
        }
       
        //loading compartment level discharge data
        List<DischargeDetailExtraEntity> dischargeTabListinstance = new List<DischargeDetailExtraEntity>();
        dischargeTabListinstance = dischargeDetailManager.GetDischargeDetailWSListByDischargeId(dischargeID);
        Session["_storeCompartmentDischargeTable"] = dischargeTabListinstance;        //loading compartment level discharge data
        List<DischargeDetailExtraEntity> ProductTabinstance = new List<DischargeDetailExtraEntity>();
        ProductTabinstance = dischargeDetailManager.GetDischargeDetailByDischargeIdAtProductlevel(dischargeID);
        Session["_storeProductDischargeTable"] = ProductTabinstance;    }
protected void DischargeTabStip_TabClick(object sender, RadTabStripEventArgs e)
    {
       
            e.Tab.PageView.Selected = true;
            string selectedtabindex = e.Tab.Text;
            Int64 shipmentID = Convert.ToInt64(ShiftTreeView.SelectedNode.Value);
            Int64 discharge = 0;
            discharge = Convert.ToInt64(Session[_selectDischargeId].ToString());
            switch (selectedtabindex)
            {
                case "Details":
                    {
                        RadPageView page = (RadPageView)e.Tab.PageView;                        List<DischargeEntity> dischargeDetails = new List<DischargeEntity>();
                        dischargeDetails = dischargeManager.GetDischargeDetailsByDischargeId(discharge);//.GetDischargeByID(discharge);
                        Session[_sesDischargeList] = dischargeDetails;
                        TextBox txtShipTo = (TextBox)page.FindControl("txt_ShipToValue");
                        TextBox txtSiteName = (TextBox)page.FindControl("txt_SiteNameValue");
                        TextBox txtAddress = (TextBox)page.FindControl("txt_AddressValue");
                        TextBox txtSplInstructions = (TextBox)page.FindControl("txt_SplInstructionValue");
                        TextBox txtPONumber = (TextBox)page.FindControl("txt_PONumberValue");
                        if (dischargeDetails.Count > 0)
                        {
                            txtShipTo.Text = dischargeDetails[0].Site_ID.ToString();
                            txtSiteName.Text = dischargeDetails[0].SiteName;
                            txtAddress.Text = dischargeDetails[0].SiteAddress + dischargeDetails[0].SiteName2;
                            txtSplInstructions.Text = dischargeDetails[0].DeliveryWindow;
                            txtPONumber.Text = dischargeDetails[0].PONumber.ToString();
                        }
                        else
                        {
                            txtShipTo.Text = MyGlobal.SDP_GUI_RADGRID_NO_RECORDS_FOUND;
                            txtSiteName.Text = MyGlobal.SDP_GUI_RADGRID_NO_RECORDS_FOUND;
                            txtAddress.Text = MyGlobal.SDP_GUI_RADGRID_NO_RECORDS_FOUND;
                            txtSplInstructions.Text = MyGlobal.SDP_GUI_RADGRID_NO_RECORDS_FOUND;
                            txtPONumber.Text = MyGlobal.SDP_GUI_RADGRID_NO_RECORDS_FOUND;
                        }                        break;
                    }
                case "Compartments":
                    {
                        DischargeCompartmentGrid();
                        (e.Tab.PageView.FindControl("CompartmentLevelDischargeRadGrid") as RadGrid).Rebind();
                        break;
                    }
                case "Products":
                    {
                        DischargeProductGrid();
                        (e.Tab.PageView.FindControl("ProductLevelDischargeRadGrid") as RadGrid).Rebind();
                        break;
                    }
            }
       
    }

Regards,
Sudhakar.
Konstantin Dikov
Telerik team
 answered on 01 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?