I am working on the RadGrid controls(Old one not the latest). In the old Rad Grid Controls, is it possible to implement the Row wise Drag and Drop option in the Grid. I have seen that in the New Telerik Rad Controls I am able to implement the drap and drop on row wise items. But I want to implement that on the old Rad Grid controls.
My Situation, we are working on a enhancement project, In the form we have rad pageview controls, radeditor, radgrid and other rad controls. what is happening is, when ever we replace the old radgrid with the latest telerik gird. it throws up an exception in javascript like : 'Javascript Registered Twice'. It looks like some where the old ajax javascript and new telerik javascript makes a conflict.
So I don't want to mess up with the existing souce code, since the application is already in production, I just want to replace the old Radgrid with New Telerik Rad Controls with Drag and drop functionality or is it possible to implement the Drag and drop option in old Rad Grid Controls. Either way is okay for us.
Please provide your suggestion how we can implement the Drag and drop for the row items.
Thanks,
Kamal
4 Answers, 1 is accepted
Microsoft JScript runtime error: Sys.InvalidOperationException: The PageRequestManager cannot be initialized more than once.
Thanks,
Kamal
Source Code:
<%
@ Page Language="VB" MasterPageFile="~/TWLiquidDesign.master" AutoEventWireup="false" CodeFile="_SiteContent.aspx.vb" Inherits="Restricted_SiteContent_" title="PropertyLogic ~ Enterprise Admin" %>
<%
@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
asp:Content ID="Content1" ContentPlaceHolderID="cphLeft" Runat="Server">
</
asp:Content>
<
asp:Content ID="Content2" ContentPlaceHolderID="cphMain" Runat="Server">
<script type="text/javascript">
function ShowEditor(whichOne,id) {
switch(whichOne) {
case "grdWebContent":
window.radopen(
"popEditWebContent.aspx?Caller=" + whichOne + "&PKey=" + id,"rwEditWebContent");
break;
case "RadGridLinks":
window.radopen(
"popEditWebContent.aspx?Caller=" + whichOne + "&PKey=" + id,"rwEditWebContent");
break;
}
}
function RefreshGrid(whichOne) {
switch(whichOne) {
case "grdWebContent":
window[
"<%=grdWebContent.ClientID %>"].AjaxRequest('<%= grdWebContent.UniqueID %>', whichOne);
break;
case "RadGridLinks":
window[
"<%=RadGridLinks.ClientID %>"].AjaxRequest('<%= RadGridLinks.UniqueID %>', whichOne);
break;
}
}
</script>
<rad:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows><rad:RadWindow ID="rwEditWebContent" runat="server" Title="WYSIWYG Content Editor" /></Windows>
</rad:RadWindowManager>
<rad:AjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server">
<asp:Image ID="Image2" SkinID="imgLoading" runat="server" />
</rad:AjaxLoadingPanel>
<
asp:Panel runat="server" ID="ConfiguratorPanel1">
<
rad:RadAjaxPanel ID="RadAjaxPanel1" LoadingPanelID="AjaxLoadingPanel1" runat="server" CssClass="form650">
<
telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<
telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" >
<
asp:Image ID="Image1" SkinID="imgLoading" runat="server" />
</
telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager runat="server" ID="radAjax" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="grdWebContent">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="grdWebContent" />
<telerik:AjaxUpdatedControl ControlID="msg" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<asp:HiddenField ID="hdnPKey" runat="server" />
<h1><img src="../App_Resources/Images/building_edit.png" alt="Manage web content - facility news, rss feeds, links, etc." /> Manage Site Content</h1>
<div class="inactive650"><asp:CheckBox ID="chkShowInactive" runat="server" Text="Show Inactive" OnCheckedChanged ="CheckedChanged" AutoPostBack="true" CssClass="tip" /></div>
<rad:RadTabStrip ID="RadTabStrip1" MultiPageID="RadMultiPage1" SelectedIndex="0" runat="server">
<Tabs>
<rad:Tab ID="tabNews" Text="News & Announcements" PageViewID="pvNews" runat="server" />
<rad:Tab ID="tabLinks" Text="Custom Links" PageViewID="pvLinks" runat="server" />
<rad:Tab ID="tabAbout" Text="Facility Description" PageViewID="pvAbout" runat="server" />
<rad:Tab ID="tabConcierge" Text="Concierge Content" PageViewID="pvConcierge" runat="server" />
</Tabs>
</rad:RadTabStrip>
<rad:RadMultiPage ID="RadMultiPage1" SelectedIndex="0" runat="server">
<rad:PageView ID="pvNews" runat="server">
<p class="tip"><PLDT:DynamicText ID="DynNewsInstructions" WebContentID="2021" runat="server" /></p>
<telerik:RadGrid runat="server" ID="grdWebContent" DataSourceID="odsNews"
GridLines="None"
OnRowDrop="grdWebContent_RowDrop"
>
<MasterTableView AutoGenerateColumns="False" DataKeyNames="PLWebContentID" NoMasterRecordsText="No news or announcements found!" CommandItemDisplay="Top" DataSourceID="odsNews">
<CommandItemTemplate>
<div class="divR"><asp:ImageButton ID="ibAddNews1" runat="server" SkinID="btnAddNew" OnClientClick="ShowEditor1('grdWebContent','0');" /></div>
</CommandItemTemplate>
<Columns>
<telerik:GridBoundColumn DataField="SortEnum" Visible="false" SortExpression="Sortenum" HeaderText="Sort enum" UniqueName="SortEnum" >
<HeaderStyle Width="35px" />
<ItemStyle Width="35px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Title" SortExpression="Title" HeaderText="Title / Headline" UniqueName="Title" >
<ItemStyle Font-Bold="True" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="BeginVisibility" SortExpression="BeginVisibility" DataFormatString="{0:d}" HeaderText="Visible" UniqueName="BeginVisibility" >
<ItemStyle Width="60px" />
<HeaderStyle Width="60px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="EndVisibility" SortExpression="EndVisibility" DataFormatString="{0:d}" HeaderText="Expiration" UniqueName="EndVisibility" >
<ItemStyle Width="60px" />
<HeaderStyle Width="60px" />
</telerik:GridBoundColumn>
<telerik:GridCheckBoxColumn DataField="active" HeaderText="Active" SortExpression="active" UniqueName="active" >
<HeaderStyle Width="50px" />
<ItemStyle Width="50px" />
</telerik:GridCheckBoxColumn>
</Columns>
</MasterTableView>
<ClientSettings AllowRowsDragDrop="True">
<Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
</ClientSettings>
<PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>
<asp:ObjectDataSource ID="odsNews" TypeName="SiteContentBLL" OnSelecting = "OnSelecting_odsNews" SelectMethod="GetWebContent" runat="server">
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="PLPropertyID" SessionField="TARGET_ID" Type="Int32" />
<asp:Parameter DefaultValue="1" Name="ContentType" Type="Int32" />
<asp:Parameter DefaultValue="False" Name="ShowInactive" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
</rad:PageView>
<rad:PageView ID="pvAbout" runat="server">
<p class="tip"><PLDT:DynamicText ID="DynAboutInstructions" WebContentID="2022" runat="server" /></p>
<rad:RadEditor ID="RadEditAbout" ShowSubmitCancelButtons="true" runat="server" Width="100%" Height="400" />
</rad:PageView>
<rad:PageView ID="pvConcierge" runat="server">
<p class="tip"><PLDT:DynamicText ID="DynConciergeInstructions" WebContentID="2023" runat="server" /></p>
<rad:RadEditor ID="RadEditConcierge" ShowSubmitCancelButtons="true" runat="server" Width="100%" Height="400" />
</rad:PageView>
<rad:PageView ID="pvLinks" runat="server">
<p class="tip"><PLDT:DynamicText ID="DynLinksInstructions" WebContentID="2024" runat="server" /></p>
<rad:RadGrid ID="RadGridLinks" DataSourceID="odsLinks" runat="server" OnDataBound="SetEntityCount" OnItemCreated="SetEntityEdit">
<ClientSettings Scrolling-AllowScroll="false" Scrolling-UseStaticHeaders="false" >
</ClientSettings>
<MasterTableView AutoGenerateColumns="false" DataKeyNames="PLWebContentID" NoMasterRecordsText="No custom links found!" CommandItemDisplay="Top">
<CommandItemTemplate>
<div class="divR"><asp:ImageButton ID="ibAddLink" runat="server" SkinID="btnAddNew" OnClientClick="ShowEditor('RadGridLinks','0');" /></div>
</CommandItemTemplate>
<Columns>
<rad:GridBoundColumn DataField="Title" SortExpression="Title" HeaderText="Title / Headline" ItemStyle-Font-Bold="true" />
<rad:GridBoundColumn DataField="BeginVisibility" SortExpression="BeginVisibility" DataFormatString="{0:d}" HeaderText="Visible" ItemStyle-Width="60" HeaderStyle-Width="60" />
<rad:GridBoundColumn DataField="EndVisibility" SortExpression="EndVisibility" DataFormatString="{0:d}" HeaderText="Expires" ItemStyle-Width="60" HeaderStyle-Width="60" />
<rad:GridCheckBoxColumn DataField="active" HeaderText="Active" SortExpression="active" UniqueName="active" ItemStyle-Width="50" HeaderStyle-Width="50" />
</Columns>
</MasterTableView>
</rad:RadGrid>
<asp:ObjectDataSource ID="odsLinks" TypeName="SiteContentBLL" SelectMethod="GetWebContent" runat="server">
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="PLPropertyID" SessionField="TARGET_ID" Type="Int32" />
<asp:Parameter DefaultValue="5" Name="ContentType" Type="Int32" />
<asp:ControlParameter ControlID="chkShowInactive" DefaultValue="False" Name="ShowInactive" PropertyName="Checked" Type="Boolean" />
</SelectParameters>
</asp:ObjectDataSource>
</rad:PageView>
</rad:RadMultiPage>
</rad:RadAjaxPanel>
</asp:Panel>
</
asp:Content>
http://www.telerik.com/help/aspnet-ajax/grdwhatsnew.html
And scroll down to Q1 2008 you see that the drag-and-drop was introduced then and previous versions did not include it.
thanks,
Kamal