This is a migrated thread and some comments may be shown as answers.

Radgrid and Ajax Manager

4 Answers 205 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sonny
Top achievements
Rank 1
Sonny asked on 20 Dec 2008, 02:03 AM
I have a simple scenario. One Radgrid and one button which are ajaxed like given below. Now when I bind the grid initially everything is fine. when I try to update the grid firing the click event of the button, this is the error I get "Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element."

I'm using the latest version of the Radcontrols, VS2008, MSSQL2005, DNN 4.9 and Linq. Any help is appreciated.

Thanks

<

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

 

 <AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="btnSearch">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid2" />

 

 

</UpdatedControls

 

</telerik:AjaxSetting> 

 

<telerik:AjaxSetting AjaxControlID="RadGrid2"> 

 

<UpdatedControls>

 

<telerik:AjaxUpdatedControl ControlID="RadGrid2"

 

 

 

LoadingPanelID="RadAjaxLoadingPanel1" />

 

<telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />

 

 

</UpdatedControls>

 

</telerik:AjaxSetting>

 

 

 

 

 

 

</AjaxSettings>

 

</

 

 

telerik:RadAjaxManager>

 

<

 

table class="table_border">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

<asp:Button ID="btnSearch" runat="server" Text="Search" />

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

</

 

 

table>

 

<

 

 

telerik:RadGrid ID="RadGrid2" AllowMultiRowSelection="True"

 

 

 

EnableEmbeddedSkins="False" Skin="Web20" runat="server" Width="100%"

 

 

 

AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"

 

 

 

AllowFilteringByColumn="True"

 

 

 

 

 

 

 

OnDetailTableDataBind="RadGrid2_DetailTableDataBind" GridLines="None">

 

 

 

 

 

 

 

<HeaderContextMenu Skin="Web20" EnableEmbeddedSkins="False" EnableTheming="True">

 

<

 

 

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

</

 

 

HeaderContextMenu>

 

 

 

 

 

 

 

<PagerStyle Mode="Slider" />

 

 

 

 

 

 

 

<ClientSettings>

 

 

 

 

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

 

 

 

 

</ClientSettings>

 

 

 

 

 

 

 

<MasterTableView DataKeyNames="ItemId,ItemTypeId" Width="100%" EditMode="PopUp" Name="Inventory">

 

 

 

<CommandItemTemplate>

 

 

 

 

 

 

 

<telerik:RadMenu ID="RadMenu1" runat="server" OnItemClick="RadMenu1_itemClick" >

 

 

 

 

 

 

 

<CollapseAnimation Type="None" Duration="0"></CollapseAnimation>

 

 

 

 

 

 

 

<Items>

 

 

 

 

 

 

 

<telerik:RadMenuItem Text="Add new Item" AccessKey="g">

 

 

 

 

 

 

 

</telerik:RadMenuItem>

 

 

 

 

 

 

 

</Items>

 

 

 

 

 

 

 

</telerik:RadMenu>

 

 

 

 

 

 

 

</CommandItemTemplate>

 

 

 

 

 

 

 

<DetailTables>

 

 

 

 

 

 

 

<telerik:GridTableView runat="server" Name="Child">

 

 

 

 

 

 

 

<RowIndicatorColumn>

 

 

 

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

 

 

 

</RowIndicatorColumn>

 

 

 

 

 

 

 

<ExpandCollapseColumn>

 

 

 

 

 

 

 

<HeaderStyle Width="20px" />

 

 

 

 

 

 

 

</ExpandCollapseColumn>

 

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="ItemId" HeaderText="ItemId"

 

 

 

UniqueName="ItemId" AllowFiltering="false">

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Belongs To" HeaderText="BelongsTo"

 

 

 

UniqueName="column2" AllowFiltering="false" Visible="false">

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="column" AllowFiltering="false">

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="SerialNum" HeaderText="SerialNum" SortExpression="SerialNum" UniqueName="SerialNum" AllowFiltering="false">

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridDateTimeColumn DataField="FirstRecieved" HeaderText="First Received" SortExpression="FirstReceived" UniqueName="FirstReceived" AllowFiltering="false">

 

 

 

 

 

 

 

</telerik:GridDateTimeColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity" AllowFiltering="false">

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn DataField="Location" HeaderText="Location" SortExpression="Location" UniqueName="Location" AllowFiltering="false">

 

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

 

</telerik:GridTableView>

 

 

 

 

 

 

 

</DetailTables>

 

<

 

 

RowIndicatorColumn>

 

<

 

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

 

RowIndicatorColumn>

 

<

 

 

ExpandCollapseColumn Visible="True">

 

<

 

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

 

ExpandCollapseColumn>

 

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

 

<telerik:GridTemplateColumn HeaderText="View/Edit" UniqueName="TemplateColumn" AllowFiltering="false">

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

<asp:LinkButton ID="lnkEdit" runat="server">View/Edit</asp:LinkButton>

 

 

</ItemTemplate> </telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="ItemId" HeaderText="Item ID" ReadOnly="True" SortExpression="ItemID" UniqueName="ItemID" Visible="true">

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="BelongsTo" HeaderText="Belongs To" SortExpression="BelongsTo" UniqueName="BelongsTo" > </telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn DataField="SerialNum" HeaderText="SerialNum" SortExpression="SerialNum" UniqueName="SerialNum">

 

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridDateTimeColumn DataField="FirstRecieved" HeaderText="First Received" SortExpression="FirstReceived" UniqueName="FirstReceived" >

 

</telerik:GridDateTimeColumn>

 

 

<telerik:GridBoundColumn DataField="Location" HeaderText="Location" SortExpression="Location" UniqueName="Location">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ItemTypeId" HeaderText="ItemTypeID" SortExpression="ItemTypeID" UniqueName="ItemTypeID" Visible="false">

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="TypeName" HeaderText="Part Number" SortExpression="TypeName" UniqueName="TypeName">

 

 

</telerik:GridBoundColumn>

 

<telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridClientSelectColumn CommandName="Select">

 

 

 </telerik:GridClientSelectColumn>

 

  

</Columns>

 

 

 

 </MasterTableView>

 

<

 

FilterMenu Skin="Web20" EnableEmbeddedSkins="False" EnableTheming="True">

 

<

 

CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

</

 

FilterMenu>

 

 </

 

telerik:RadGrid>

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 22 Dec 2008, 09:37 AM
Hello Sonny,

Could you please try to isolate the application form the DNN platform and verify if the regular isolated project will behaves the same way?
This error could accrue in cases you are using the Classic RadAjax and the MS ScriptManager in one application or UpdatePanel and AjaxManager in the same project. Please review your settings and verify of this could be the problem in your scenario.

All the best,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sonny
Top achievements
Rank 1
answered on 29 Dec 2008, 06:41 PM
Hi Maria,

The regular site (without DNN) does not have any issues. I am able to update the controls without a problem.  I did try to add the RadScriptmanager to the module and its gave me an error saying "PageRequestmanager cannot be initialized more than once."  pointing to the fact that there is already a Script manager on the DNN. I do have the old controls (1.8.1.0) installed on my machine, but not actually using it in this project. Moving the code to a different server does not remove the error.
0
Maria Ilieva
Telerik team
answered on 30 Dec 2008, 02:14 PM
Hello Sonny,

I suggest that you isolate the problem in a runnable DNN module so we could test it locally and investigate the issue in depth for finding the exact reason for the problem.

Best wishes,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sonny
Top achievements
Rank 1
answered on 30 Dec 2008, 06:22 PM
Hi Maria,
I have a ticket open and did try to upload the project which had the dnn, database and code but was unable to upload the files. I was able to solve the issue using RadAjaxManagerProxy. 
Tags
Grid
Asked by
Sonny
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Sonny
Top achievements
Rank 1
Share this question
or