or
<telerik:GridCheckBoxColumn DataField="TypeDefault" DataType="System.Boolean" FilterControlAltText="Filter TypeDefault column" HeaderText="Default" UniqueName="TypeDefault"></telerik:GridCheckBoxColumn><telerik:GridCalculatedColumn UniqueName="Name" SortExpression="LastName" HeaderText="Calculated Column"
DataFields="FirstName, LastName" Expression='{0} + " " + {1}' FooterText="CalculatedColumn footer">
</telerik:GridCalculatedColumn><!-- Page Content --> <div id="content" class="content" > <div id="availableTaxyearsDiv" class="available-taxyears"> <table><tr><td><asp:label ID="taxYearLabel" Text="Select Tax Year:" runat="server" Width="120"></asp:label></td><td><asp:DropDownList Width="150" OnSelectedIndexChanged="TaxYearDropDown_SelectedIndexChanged" ID="taxYearDropDown" runat="server"></asp:DropDownList></td></tr></table> </div> <telerik:RadTabStrip Skin="Vista" runat="server" ID="TabStrip1" MultiPageID="taskAlertMultiPage" SelectedIndex="0"> <Tabs> <telerik:RadTab runat="server" Text="Tasks" PageViewID="taskPageView" /> <telerik:RadTab runat="server" Text="Alerts" PageViewID="alertsPageView" /> </Tabs> </telerik:RadTabStrip> <telerik:RadMultiPage runat="server" ID="taskAlertMultiPage" SelectedIndex="0" RenderSelectedPageOnly="false"> <telerik:RadPageView runat="server" ID="taskPageView"> <div id="TaskGrid" runat="server"> <telerik:RadGrid ID="tasksRadGrid" Width="1000" OnNeedDataSource="TasksRadGrid_NeedDataSource" runat="server" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" PageSize="15" GridLines="Both" OnItemDataBound="TasksRadGrid_ItemDataBound" OnItemEvent="TasksRadGrid_ItemEvent" OnItemCommand="TasksRadGrid_ItemCommand" AutoGenerateColumns="false" Skin="Vista" AllowFilteringByColumn="true" > <PagerStyle Mode="NumericPages"></PagerStyle> <MasterTableView EnableViewState="true" DataKeyNames="ClientID,EntityID,ExtDocID,ID,DocumentName,TaskName,EntityCode,EntityCodeDesc,ExplorerViewName,UserRole,UserType,PeriodLocked" AllowMultiColumnSorting="True" HierarchyLoadMode="ServerOnDemand"> <NestedViewTemplate> <asp:Panel runat="server" ID="InnerContainer" CssClass="detailTable"> <telerik:RadTabStrip Skin="Vista" runat="server" ID="taskActionTabStrip" MultiPageID="taskActionMultiPage" SelectedIndex="0"> <Tabs> <telerik:RadTab runat="server" Text="Delegation" PageViewID="DelegationPageView" /> <telerik:RadTab runat="server" Text="Unlock" PageViewID="UnlockPageView" /> <telerik:RadTab runat="server" Text="Request More Information" PageViewID="RequestInfoPageView" /> </Tabs> </telerik:RadTabStrip> <telerik:RadMultiPage runat="server" ID="taskActionMultiPage" SelectedIndex="0" RenderSelectedPageOnly="false"> <telerik:RadPageView runat="server" ID="DelegationPageView" BackColor="#EFEFF7"> <asp:Panel ID="Panel1" runat="server" > <table id="DelegationTable"> <tr> <td> <table> <tr> <td colspan="2" width="130"> <asp:Label ID="lblDelegation" runat="server">Delegate Task To:</asp:Label> </td> <td align="left"> <asp:DropDownList Width="150" OnSelectedIndexChanged="DelegateDropDown_SelectedIndexChanged" ID="delegateDropDown" runat="server"> <asp:ListItem Text="" Value="" /> </asp:DropDownList> </td> <td align="left"> <asp:Button Width="60" ID="delegation" runat="server" Text="Save" OnClick="DelegationButton_Click" /> </td> </tr> <tr> <td></td> </tr> <tr> <td colspan="4"> <asp:Label ID="delegateStatus" runat="server" /> </td> </tr> <tr><td></td></tr> <tr> <td></td> <td colspan="3"> <asp:LinkButton CssClass="linkButton" ID="cancelDelegation" runat="server" Text="" OnClick="CancelDelegation_Click"></asp:LinkButton> </td> </tr> <tr> <td></td> <td colspan="3"> <asp:LinkButton CssClass="linkButton" ID="rejectDelegation" runat="server" Text="" OnClick="RejectDelegation_Click"></asp:LinkButton> </td> </tr> </table> </td> </tr> </table> </asp:Panel> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="UnlockPageView"> <table id="UnlockTable"> <tr><td></td></tr> <tr> <td> <table> <tr> <td colspan="3"> <asp:Label ID="lockStatus" runat="server" Text="" /> </td> </tr> </table> <table> <tr><td></td></tr> <tr> <td><asp:Label ID="unlockDocument" runat="server" Text="" /></td> <td> <asp:Button CssClass="button" ID="btnUnlock" runat="server" Text="Yes" OnClick="UnlockButton_Click" Visible="true"></asp:Button> </td> </tr> </table> </td> </tr> </table> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="RequestInfoPageView"> <asp:Panel ID="MoreInfoPanel" runat="server"> <table id="RequestMoreInfoTable"> <tr> <td></td> </tr> <tr> <td> <table> <tr> <td class="indent"> </td> <td align="left"> Select Alert Recipient(s): </td> <td align="left"> <asp:DropDownList Width="200" ID="alertRecipients" runat="server"> <asp:ListItem Text="" Value="" /> </asp:DropDownList> </td> </tr> <tr> <td class="indent"> </td> <td align="left"> Enter Alert Subject: </td> <td align="left"> <asp:TextBox Width="300px" ID="alertSubject" runat="server"></asp:TextBox> </td> </tr> <tr> <td> </td> </tr> <tr> <td class="indent"> </td> <td colspan="2" align="left" valign="top"> Enter Alert Text Below: </td> </tr> <tr> <td class="indent"> </td> <td colspan="2" align="right"> <telerik:RadEditor ID="radEditAlertText" Height="200px" Width="500px" ToolsFile="RadControls/Editor/BasicTools.xml" ShowSubmitCancelButtons="false" ShowHtmlMode="false" ShowPreviewMode="false" Skin="Default" SkinsPath="~/App_Themes/Vertex/Editor" runat="server"> <Content></Content> </telerik:RadEditor> </td> </tr> <tr align="right"> <td> </td> <td colspan="2"> <asp:Button ID="btnSendAlert" Text="Send Alert" CommandName="RequestMoreInfo" runat="server" OnClick="SendAlertButton_Click" /> </td> </tr> </table> </td> </tr> </table> </asp:Panel> </telerik:RadPageView> </telerik:RadMultiPage> </asp:Panel> </NestedViewTemplate> <Columns> <telerik:GridBoundColumn HeaderText="" DataField="DocumentUserID" UniqueName="DocumentUserID" Visible="false"/> <telerik:GridBoundColumn HeaderText="" DataField="ExplorerViewID" UniqueName="ExplorerViewID" Visible="false"/> <telerik:GridBoundColumn HeaderText="" DataField="ExtDocID" UniqueName="ExtDocID" Visible="false"/> <telerik:GridBoundColumn HeaderText="" DataField="LockedUserName" UniqueName="LockedUserName" Visible="false"/> <telerik:GridBoundColumn HeaderText="" DataField="UserID" UniqueName="UserID" Visible="false"/> <telerik:GridBoundColumn HeaderText="" DataField="DelegateUserID" UniqueName="DelegateUserID" Visible="false"/> <telerik:GridBoundColumn HeaderText="" DataField="ID" UniqueName="ID" Visible="false"/> <telerik:GridBoundColumn SortExpression="EntityObligationID" UniqueName="EntityObligationID" DataField="EntityObligationID" Visible="false"/> <telerik:GridBoundColumn SortExpression="ObligationType" UniqueName="ObligationType" DataField="ObligationType" Visible="false"/> <telerik:GridButtonColumn CommandName="Download" ButtonType="ImageButton" ImageUrl="Images/download.gif" Text="Download Document" UniqueName="Download" HeaderStyle-Width="35px" Visible="false"/> <telerik:GridBoundColumn FooterStyle-Wrap="false" SortExpression="ClientName" ItemStyle-Wrap="false" HeaderText="Client" HeaderButtonType="TextButton" DataField="ClientName" UniqueName="ClientName" HeaderStyle-Width="140px" Visible="true"/> <telerik:GridBoundColumn SortExpression="EntityCode" ItemStyle-Wrap="false" HeaderText="Entity" HeaderButtonType="TextButton" DataField="EntityCode" UniqueName="EntityCode" HeaderStyle-Width="140px" Visible="false"/> <telerik:GridBoundColumn SortExpression="EntityCodeDesc" ItemStyle-Wrap="false" HeaderText="Entity" HeaderButtonType="TextButton" DataField="EntityCodeDesc" UniqueName="EntityCodeDesc" HeaderStyle-Width="140px" Visible="false"/> <telerik:GridBoundColumn SortExpression="ExplorerViewName" FooterStyle-Wrap="false" ItemStyle-Wrap="false" HeaderText="Template Name" HeaderButtonType="TextButton" DataField="ExplorerViewName" UniqueName="ExplorerViewName" Visible="false"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn DataField="DocumentName" UniqueName="DocumentName" HeaderText="Document / Task Name" HeaderStyle-Width="240px" Visible="false"> <ItemTemplate> <asp:LinkButton ID="DocumentNameLinkButton" OnClick="DownloadDocument_Click" runat="server" Text='<%# Bind("DocumentName") %>' /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="TaskName" UniqueName="TaskName" HeaderText="Document / Task Name"> <ItemTemplate> <asp:LinkButton ID="TaskNameLinkButton" OnClick="DownloadDocument_Click" runat="server" Text='<%# Bind("TaskName") %>' /> <telerik:RadToolTip id="TaskNameToolTip" TargetControlID="TaskNameLinkButton" Position="BottomCenter" Text="Hello" runat="server"/> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn SortExpression="UserRole" FooterStyle-Wrap="false" ItemStyle-Wrap="false" HeaderText="User Role" HeaderButtonType="TextButton" DataField="UserRole" UniqueName="UserRole" HeaderStyle-Width="120px" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="UserType" FooterStyle-Wrap="false" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="UserType" UniqueName="UserType" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="ObligationName" ItemStyle-Wrap="false" HeaderText="Obligation" HeaderButtonType="TextButton" DataField="ObligationName" UniqueName="ObligationName" HeaderStyle-Width="120px" Visible="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="PeriodName" ItemStyle-Wrap="false" HeaderText="Period" HeaderButtonType="TextButton" DataField="PeriodName" UniqueName="PeriodName" HeaderStyle-Width="120px" Visible="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="PeriodLocked" ItemStyle-Wrap="false" HeaderText="Period Locked" HeaderButtonType="TextButton" DataField="PeriodLocked" UniqueName="PeriodLocked" HeaderStyle-Width="120px" Visible="false"> </telerik:GridBoundColumn> <telerik:GridDateTimeColumn DataFormatString="{0:M/d/yyyy}" SortExpression="DueDate" ItemStyle-Wrap="false" HeaderText="Due Date" HeaderButtonType="TextButton" DataField="DueDate" UniqueName="DueDate" HeaderStyle-Width="126px" Visible="true"> </telerik:GridDateTimeColumn> <telerik:GridBoundColumn SortExpression="CurrentStatus" ItemStyle-Wrap="false" HeaderText="Status" HeaderButtonType="TextButton" DataField="CurrentStatus" UniqueName="CurrentStatus" AllowFiltering="false" HeaderStyle-Width="80px" Visible="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="Status" ItemStyle-Wrap="false" HeaderText="Status" HeaderButtonType="TextButton" DataField="Status" UniqueName="Status" AllowFiltering="false" HeaderStyle-Width="80px" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="AssignedUserID" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="AssignedUserID" UniqueName="AssignedUserID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="ApproverUserID" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="ApproverUserID" UniqueName="ApproverUserID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="FirstReviewerUserID" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="FirstReviewerUserID" UniqueName="FirstReviewerUserID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="SecondReviewerUserID" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="SecondReviewerUserID" UniqueName="SecondReviewerUserID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="AssignedDelegateID" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="AssignedDelegateID" UniqueName="AssignedDelegateID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="ApproverDelegateID" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="ApproverDelegateID" UniqueName="ApproverDelegateID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="FirstReviewerDelegateID" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="FirstReviewerDelegateID" UniqueName="FirstReviewerDelegateID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="SecondReviewerDelegateID" ItemStyle-Wrap="false" HeaderButtonType="TextButton" DataField="SecondReviewerDelegateID" UniqueName="SecondReviewerDelegateID" Visible="false"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true"> <Resizing AllowColumnResize="true" AllowRowResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true" /> <Scrolling AllowScroll="true" FrozenColumnsCount="0" EnableVirtualScrollPaging="false" UseStaticHeaders="true" SaveScrollPosition="true" /> </ClientSettings> </telerik:RadGrid> <div id="refresh"> <asp:panel id="RefreshPanel" runat="server"> <table> <tr> <td> </td> </tr> <tr> <td width="440"> </td> <td align="right"> <asp:Button EnableTheming="true" ID="RefreshTasksGrid" runat="server" Text="Refresh Tasks" OnClick="RefreshTasksGrid_Click" /> </td> </tr> </table> </asp:panel> </div> </div> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="alertsPageView"> <telerik:RadGrid ID="AlertsGrid" Width="1000" runat="server" OnNeedDataSource="AlertsGrid_NeedDataSource" ShowGroupPanel="false" OnItemCommand="AlertsGrid_ItemCommand" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" PageSize="20" GridLines="Both" AutoGenerateColumns="false" Skin="Vista" AllowFilteringByColumn="true"> <PagerStyle Mode="NumericPages"></PagerStyle> <MasterTableView EnableViewState="true" DataKeyNames="AlertID,ClientID,EntityID,ClientName" AllowMultiColumnSorting="True" HierarchyLoadMode="ServerOnDemand"> <NestedViewTemplate> <table class="detailTable" cellpadding="0px"> <tr> <td class="headerText"> Alert Contents </td> </tr> <tr> <td> <asp:Label Width="600" ID="bodyText" runat="server" /> </td> </tr> </table> <asp:Panel runat="server" ID="delegationResponsePanel" Visible="false"> <table class="detailTable"> <tr> <td> </td> </tr> <tr> <td class="headerText"> Delegation Response </td> </tr> <tr id="delegateResponse"> <td> Would you like to <asp:LinkButton CssClass="linkButton" ID="acceptDelegation" Text="accept" runat="server" OnClick="AcceptDelegation_Click" /> this delegation. </td> </tr> </table> </asp:Panel> <asp:Panel runat="server" ID="helpResponsePanel" Visible="false"> <table class="detailTable"> <tr> <td class="spacer"> </td> </tr> <tr> <td> <asp:LinkButton ID="btnHelpResponse" CssClass="linkButton" Text="Click here to respond to this request for more information." OnClick="HelpResponseButton_Click" runat="server"></asp:LinkButton> </td> </tr> </table> </asp:Panel> <asp:Panel runat="server" ID="createResponseAlertPanel" Visible="false"> <table class="detailTable"> <tr> <td> <table> <tr> <td class="indent"> </td> <td align="left"> Select Alert Recipient(s): </td> <td align="left"> <asp:DropDownList Width="200" ID="alertRecipients" runat="server"> <asp:ListItem Text="" Value="" /> </asp:DropDownList> </td> </tr> <tr> <td class="indent"> </td> <td align="left"> Enter Alert Subject: </td> <td align="left"> <asp:TextBox Width="300px" ID="alertSubject" runat="server"></asp:TextBox> </td> </tr> <tr> <td> </td> </tr> <tr> <td class="indent"> </td> <td colspan="2" align="left" valign="top"> Enter Alert Text Below: </td> </tr> <tr> <td class="indent"> </td> <td colspan="2" align="right"> <telerik:RadEditor ID="radEditAlertText" Height="200px" Width="500px" ToolsFile="RadControls/Editor/BasicTools.xml" ShowSubmitCancelButtons="false" ShowHtmlMode="false" ShowPreviewMode="false" Skin="Default" SkinsPath="~/App_Themes/Vertex/Editor" runat="server"> <Content></Content> </telerik:RadEditor> </td> </tr> <tr align="right"> <td> </td> <td colspan="2"> <asp:Button ID="btnSendAlert" Text="Send Alert" CommandName="ResponseToRequest" runat="server" OnClick="SendAlertButton_Click" /> </td> </tr> </table> </td> </tr> </table> </asp:Panel> <table class="detailTable" cellpadding="0px"> <tr> <td></td> <td> <asp:button ID="DeleteAlert" Text="Delete Alert" CommandName="DeleteAlert" runat="server" OnClick="DeleteAlert_Click" /> </td> </tr> </table> </NestedViewTemplate> <Columns> <telerik:GridBoundColumn SortExpression="EventName" HeaderText="Alert Event" HeaderButtonType="TextButton" DataField="EventName" UniqueName="EventName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="ClientName" HeaderText="Client Name" HeaderButtonType="TextButton" DataField="ClientName" UniqueName="ClientName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="EntityCode" HeaderText="Entity" HeaderButtonType="TextButton" DataField="EntityCode" UniqueName="EntityCode" Visible="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="Obligation" HeaderText="Obligation" HeaderButtonType="TextButton" DataField="Obligation" UniqueName="Obligation"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="Period" HeaderText="Period" HeaderButtonType="TextButton" DataField="Period" UniqueName="Period"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="SubjectText" HeaderText="Alert Subject" HeaderButtonType="TextButton" DataField="SubjectText" UniqueName="SubjectText"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="CreateDateTime" HeaderText="Creation Date" HeaderButtonType="TextButton" DataField="CreateDateTime" UniqueName="CreateDateTime"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="CreateUserName" HeaderText="User" HeaderButtonType="TextButton" DataField="CreateUserName" UniqueName="CreateUserName" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="BodyText" HeaderText="" HeaderButtonType="TextButton" DataField="BodyText" UniqueName="BodyText" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="" DataField="EventTypeID" UniqueName="EventTypeID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="" DataField="CreateUserID" UniqueName="CreateUserID" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="" DataField="ID" UniqueName="ID" Visible="false"> </telerik:GridBoundColumn> </Columns> </MasterTableView> <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true"> <Resizing AllowColumnResize="true" AllowRowResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true" /> </ClientSettings> </telerik:RadGrid> <div id="Div1"> <asp:panel id="Panel2" runat="server"> <table> <tr> <td> </td> </tr> <tr> <td width="440"> </td> <td align="right"> <asp:Button EnableTheming="true" ID="RefreshAlertsGrid" runat="server" Text="Refresh Alerts" OnClick="RefreshAlertsGrid_Click" /> </td> </tr> </table> </asp:panel> </div> </telerik:RadPageView> </telerik:RadMultiPage> </div>PRM_MissingPanel : Could not find UpdatePanel with ID UpdatePanel1.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StopsMgr.aspx.cs" Inherits="Test.StopsMgr" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Stop Manager</title> <link href="css/StopsMgr.css" rel="stylesheet" type="text/css" /></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <%--Needed for JavaScript IntelliSense in VS2010--%> <%--For VS2008 replace RadScriptManager with ScriptManager--%> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <div id="TabStop"> <telerik:RadAjaxLoadingPanel ID="StopLoadingPanel" runat="server"> </telerik:RadAjaxLoadingPanel> <telerik:RadCodeBlock ID="RadCodeBlock_StopScript" runat="server"> <script type="text/javascript"> function showLoadingPanel(sender, args) { toggleLoadingPanel(sender.get_id(), true); } function hideLoadingPanel(sender, args) { toggleLoadingPanel(sender.get_id(), false); } function toggleLoadingPanel(elementId, show) { var loadingPanel = $find("StopLoadingPanel"); if (show) { loadingPanel.show(elementId); } else { loadingPanel.hide(elementId); } } function clientDragCreating(sender, args) { var grid = $find("<%=GridSearchStops.ClientID %>"); var MasterTable = grid.get_masterTableView(); var selectedRows = MasterTable.get_selectedItems(); var name = MasterTable.getCellByColumnUniqueName(selectedRows[0], "Name"); var lines = MasterTable.getCellByColumnUniqueName(selectedRows[0], "Lines"); $("#rgDraggedItemHeader").html(name.innerHTML); $("#rgDraggedItemSub").html(lines.innerHTML); } var currentGrid; var zone; var mouseX; var mouseY; var displayPlaceholder = false; function onRowDragStarted(sender, args) { currentGrid = sender; zone = $find("RadDockZoneStops"); $(document).mousemove(function (e) { mouseX = e.pageX; mouseY = e.pageY; if (zone != null && displayPlaceholder) zone._showPlaceholder(args.get_gridDataItem()); }); $("#RadDockZoneStops").mouseenter(function () { displayPlaceholder = true; }).mouseleave(function () { displayPlaceholder = false; if (zone != null) zone._hidePlaceholder(); }); } function onRowDropping(sender, args) { zone = $find("RadDockZoneStops"); if (zone != null) zone._hidePlaceholder(); $(document).unbind('mousemove'); $("#RadDockZoneStops").unbind('mouseenter').unbind('mouseleave'); if (sender.get_id() == "<%=GridSearchStops.ClientID %>") { var node = args.get_destinationHtmlElement(); if (isChildOf('RadDockZoneStops', node)) { $find("<%= RadAjaxPanel1.ClientID%>").ajaxRequestWithTarget("<%= RadAjaxPanel1.UniqueID %>", "LoadDock¤" + args._dragedItems[0].getDataKeyValue('Id')); args.set_cancel(true); } } args.set_cancel(true); } function isChildOf(parentId, element) { while (element) { if (element.id && element.id.indexOf(parentId) > -1) { return true; } element = element.parentNode; } return false; } </script> </telerik:RadCodeBlock> <div id="Search"> <telerik:RadGrid ID="GridSearchStops" runat="server" AllowPaging="true" PageSize="42" AutoGenerateColumns="false" Height="820px" > <PagerStyle Mode="NextPrevNumericAndAdvanced" /> <MasterTableView TableLayout="Fixed" DataKeyNames="Id" ClientDataKeyNames="Id"> <Columns> <telerik:GridBoundColumn DataField="Id" HeaderText="ID" /> <telerik:GridBoundColumn DataField="Name" HeaderText="Stop Name" /> <telerik:GridBoundColumn DataField="Lines" HeaderText="Currently On Lines" /> </Columns> </MasterTableView> <ClientSettings AllowRowsDragDrop="true"> <Scrolling AllowScroll="true" EnableVirtualScrollPaging="true" UseStaticHeaders="true" /> <DataBinding Location="StopsMgr.aspx" SelectMethod="GetStopData" SelectCountMethod="GetStopCount" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maxRows" /> <ClientEvents OnCommand="showLoadingPanel" OnDataBound="hideLoadingPanel" OnRowDragStarted="onRowDragStarted" OnRowDropping="onRowDropping" /> <Selecting AllowRowSelect="true" /> </ClientSettings> </telerik:RadGrid> <ext:GridCustomDragExtender ID="GridCustomDragExtender1" runat="server" TargetControlID="GridSearchStops" CursorOffsetLeft="0" CursorOffsetTop="0" OnClientDragContentCreating="clientDragCreating"> <DragContentTemplate> <div class="rgDraggedItem"> <div id="rgDraggedItemHeader"> </div> <div id="rgDraggedItemSub"> </div> </div> </DragContentTemplate> </ext:GridCustomDragExtender> </div> <div id="DropZone"> <input type="text" id="currentPlaceholderPosition" runat="server" style="display: none" /> <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" OnAjaxRequest="OnAjaxRequest_Action"> <telerik:RadDockLayout ID="RadDockLayout1" runat="server" OnLoadDockLayout="RadDockLayout1_LoadDockLayout" OnSaveDockLayout="RadDockLayout1_SaveDockLayout"> <telerik:RadDockZone ID="RadDockZoneStops" runat="server" MinHeight="300px" HighlightedCssClass="RadDockZoneStopsHighlight"> </telerik:RadDockZone> <div style="display: none"> Hidden UpdatePanel, which is used to receive the new dock controls. We will move them with script to the desired initial dock zone. <asp:UpdatePanel runat="server" ID="UpdatePanel1"> <Triggers> <asp:AsyncPostBackTrigger ControlID="GridSearchStops" EventName="RowDrop" /> </Triggers> </asp:UpdatePanel> </div> </telerik:RadDockLayout> </telerik:RadAjaxPanel> </div> </div> <script type="text/javascript"> var $T = Telerik.Web.UI; var isRowDragged = false; //parameter can be dock or GridDataItem Telerik.Web.UI.RadDockZone.prototype._showPlaceholder = function (obj, location) { if (Object.getTypeName(obj) == "Telerik.Web.UI.GridDataItem") { isRowDragged = true; var row = obj; this._repositionPlaceholder(row.get_element(), location); var placeholderStyle = this._placeholder.style; placeholderStyle.height = "50px"; placeholderStyle.width = "100%"; placeholderStyle.display = "block"; isRowDragged = false; } else { var dock = obj; this._repositionPlaceholder(dock.get_element(), location); var dockBounds = dock._getBounds(); var placeholderMargin = dock._getMarginBox(this._placeholder); var placeholderBorder = dock._getBorderBox(this._placeholder); var horizontal = this.get_isHorizontal(); var placeholderStyle = this._placeholder.style; placeholderStyle.height = dockBounds.height - (placeholderMargin.vertical + placeholderBorder.vertical) + "px"; placeholderStyle.width = this.get_fitDocks() && !horizontal ? "100%" : dockBounds.width - (placeholderMargin.horizontal + placeholderBorder.horizontal) + "px"; placeholderStyle.display = "block"; } } Telerik.Web.UI.RadDockZone.prototype._repositionPlaceholder = function (dock_element, location) { //fix Row drag if (isRowDragged == true) { location = new Sys.UI.Point(mouseX, mouseY); } //end fix var nearestChild = this._findItemAt(location, dock_element); var zone_element = this.get_element(); if (null == nearestChild) { // _clearElement must be after all docks and _placeholder zone_element.insertBefore(this._placeholder, this._clearElement); } else { if (nearestChild.previousSibling != this._placeholder) { zone_element.insertBefore(this._placeholder, nearestChild); } } //GET placeholder position for (var i = 0; i < zone_element.childNodes.length; i++) { if (zone_element.childNodes[i] == this._placeholder) { var currentPos = i; $get('currentPlaceholderPosition').value = currentPos - 2; } } //end Get } </script> </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 System.Web.Services;using System.Data.SqlClient;using System.Web.Configuration;using System.Data;using Telerik.Web.UI;namespace test{ public partial class StopsMgr : System.Web.UI.Page { private List<DockState> CurrentDockStates { get { //Store the info about the added docks in the session. For real life // applications we recommend using database or other storage medium // for persisting this information. List<DockState> _currentDockStates = (List<DockState>)Session["CurrentDockStatesDynamicDocks"]; if (Object.Equals(_currentDockStates, null)) { _currentDockStates = new List<DockState>(); Session["CurrentDockStatesDynamicDocks"] = _currentDockStates; } return _currentDockStates; } set { Session["CurrentDockStatesDynamicDocks"] = value; } } private RadDock CreateRadDockFromState(DockState state) { RadDock dock = new RadDock(); dock.ID = string.Format("RadDock{0}", state.UniqueName); dock.ApplyState(state); dock.Command += new DockCommandEventHandler(dock_Command); dock.Commands.Add(new DockCloseCommand()); dock.Commands.Add(new DockExpandCollapseCommand()); return dock; } protected void Page_Init(object sender, EventArgs e) { //Recreate the docks in order to ensure their proper operation for (int i = 0; i < CurrentDockStates.Count; i++) { RadDock dock = CreateRadDockFromState(CurrentDockStates[i]); //We will just add the RadDock control to the RadDockLayout. // You could use any other control for that purpose, just ensure // that it is inside the RadDockLayout control. // The RadDockLayout control will automatically move the RadDock // controls to their corresponding zone in the LoadDockLayout // event (see below). RadDockLayout1.Controls.Add(dock); //We want to save the dock state every time a dock is moved. CreateSaveStateTrigger(dock); } } protected void Page_Load(object sender, EventArgs e) { //this.DataBind(); } #region Stops [WebMethod] public static int GetStopCount() { var cmd = new SqlCommand("P_GetNumberOfStops", new SqlConnection(WebConfigurationManager.ConnectionStrings["TestDB"].ConnectionString)); cmd.CommandType = CommandType.StoredProcedure; cmd.Connection.Open(); if (cmd.Connection.State != ConnectionState.Open) throw new Exception("Connection to DB failed"); var max = (int)cmd.ExecuteScalar(); cmd.Connection.Close(); return max; } [WebMethod] public static IEnumerable<Stop> GetStopData(int startRowIndex, int maxRows) { var cmd = new SqlCommand("P_GetStopData", new SqlConnection(WebConfigurationManager.ConnectionStrings["TestDB"].ConnectionString)); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@startRow", SqlDbType.Int)); cmd.Parameters.Add(new SqlParameter("@maxRows", SqlDbType.Int)); cmd.Parameters["@startRow"].Value = startRowIndex; cmd.Parameters["@maxRows"].Value = startRowIndex + maxRows; cmd.Connection.Open(); if (cmd.Connection.State != ConnectionState.Open) throw new Exception("Connection to DB failed"); var sqlRd = cmd.ExecuteReader(); if (sqlRd.HasRows) { while (sqlRd.Read()) { var stop = new Stop() { Id = (int)sqlRd["S_ID"], Name = sqlRd["S_NAME"].ToString(), Lines = "---" }; yield return stop; } } cmd.Connection.Close(); } #region DockPanel void dock_Command(object sender, DockCommandEventArgs e) { if (e.Command.Name == "Close") { ScriptManager.RegisterStartupScript( UpdatePanel1, this.GetType(), "RemoveDock", string.Format(@"function _removeDock() {{ Sys.Application.remove_load(_removeDock); $find('{0}').undock(); $get('{1}').appendChild($get('{0}')); $find('{0}').doPostBack('DockPositionChanged'); }}; Sys.Application.add_load(_removeDock);", ((RadDock)sender).ClientID, UpdatePanel1.ClientID), true); } } private void CreateSaveStateTrigger(RadDock dock) { //Ensure that the RadDock control will initiate postback // when its position changes on the client or any of the commands is clicked. //Using the trigger we will "ajaxify" that postback. dock.AutoPostBack = true; dock.CommandsAutoPostBack = true; AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger(); saveStateTrigger.ControlID = dock.ID; saveStateTrigger.EventName = "DockPositionChanged"; UpdatePanel1.Triggers.Add(saveStateTrigger); saveStateTrigger = new AsyncPostBackTrigger(); saveStateTrigger.ControlID = dock.ID; saveStateTrigger.EventName = "Command"; UpdatePanel1.Triggers.Add(saveStateTrigger); } protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e) { //Populate the event args with the state information. The RadDockLayout control // will automatically move the docks according that information. foreach (DockState state in CurrentDockStates) { e.Positions[state.UniqueName] = state.DockZoneID; e.Indices[state.UniqueName] = state.Index; } } protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e) { //Save the dock state in the page Session. This will enable us // to recreate the dock in the next Page_Init. CurrentDockStates = RadDockLayout1.GetRegisteredDocksState(); } protected void OnAjaxRequest_Action(object sender, AjaxRequestEventArgs e) { var args = e.Argument.Split('¤'); if (args[0] == "LoadDock" && args.Length > 1) { var dock = LoadDock(int.Parse(args[1])); var currentPos = int.Parse(currentPlaceholderPosition.Value); UpdatePanel1.ContentTemplateContainer.Controls.Add(dock); ScriptManager.RegisterStartupScript( dock, this.GetType(), "AddDock", string.Format(@"function _addDock() {{ Sys.Application.remove_load(_addDock); $find('{1}').dock($find('{0}'),{2}); $find('{0}').doPostBack('DockPositionChanged'); }}; Sys.Application.add_load(_addDock);", dock.ClientID, RadDockZoneStops.ID, currentPos), true); CreateSaveStateTrigger(dock); } } private RadDock LoadDock(int id) { try { var dock = new RadDock(); dock.DockMode = DockMode.Docked; dock.EnableRoundedCorners = true; dock.UniqueName = Guid.NewGuid().ToString(); dock.ID = string.Format("RadDock{0}", dock.UniqueName); dock.Title = "Title " + id; var widget = LoadControl(this, "~/Templates/StopFormTpl.ascx", id, "myTitle"); widget.EnableViewState = false; dock.ContentContainer.Controls.Add(widget); dock.Width = Unit.Percentage(100); dock.Height = Unit.Pixel(200); dock.Commands.Add(new DockCloseCommand()); dock.Commands.Add(new DockExpandCollapseCommand()); dock.Command += new DockCommandEventHandler(dock_Command); return dock; } catch (Exception ex) { throw new Exception(ex.Message, ex.InnerException); } }