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

Usercontrol as editform with update panel

4 Answers 224 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ruud
Top achievements
Rank 1
Ruud asked on 03 Jun 2010, 12:20 PM
Hello, I have a problem with a usercontrol as editform in a radgrid. In the usercontrol is a checkbox and a combobox. The combobox is made visible as the checkbox gets checked. This works fine without "Ajaxifing" the control (so full pageback is posted).  I'm trying to get the checkbox and the combobox in a updatepanel, but then I get the following error: Jscript runtime error: (...) could not find UpdatePanel with ID 'Radgrid1.(..)..UpdatePanel1. If it is being updated dynamically then it must be inside another UpdatePanel

This is de usercontrol

<%@ Control Language="VB" AutoEventWireup="true" CodeFile="GridEdit4.vb" Inherits="GridEdit4" %> 
 
<asp:UpdatePanel ID="UpdatePanel1" runat="server" > 
  <ContentTemplate> 
    <asp:panel runat="server" ID="pUpdate">  
      <asp:CheckBox runat="server" id="chkUpdate" OnCheckedChanged="updateCombobox" AutoPostBack="true" /> 
      <asp:Label runat="server" ID="lbUpdate" Text="Update test" /> 
      <telerik:radcombobox runat="server" ID="cmbUpdate" Visible="false"  ></telerik:radcombobox> 
    </asp:panel> 
  </ContentTemplate> 
</asp:UpdatePanel> 
 
 

 And some snapshots from the aspx file
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="true" > 
  <Scripts> 
    <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" /> 
  </Scripts> 
</telerik:RadScriptManager> 
      
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" > 
  <AjaxSettings> 
    <telerik:AjaxSetting AjaxControlID="FormatieRadgrid">  
      <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="FormatieRadgrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
        <telerik:AjaxUpdatedControl ControlID="GridEdit4" LoadingPanelID="UpdatePanel1" /> 
      </UpdatedControls> 
    </telerik:AjaxSetting> 
  </AjaxSettings> 
</telerik:RadAjaxManager> 
   
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />     
       
 
 
<!-- This is a snapshot from the Radgrid: --> 
 
    </Columns> 
      <EditFormSettings UserControlName="GridEdit4.ascx" EditFormType="WebUserControl">  
        <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
      </EditFormSettings> 
                                
  </telerik:GridTableView> 
</DetailTables> 
 

What should be done to get to UpdatePanel work in the Usercontrol?

Regards,
-Ruud Feringa

4 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 08 Jun 2010, 03:58 PM
Hi Ruud,

It is not advisable to use UpdatePanel and AjaxManager for ajaxifying the same page content/controls, as this could lead to unexpected behavior of the page (most probably this is the cause for the error you get). You should choose between AjaxManager and UpdatePanel, but use them both.

Regards,
Tsvetina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ruud
Top achievements
Rank 1
answered on 09 Jun 2010, 03:39 PM
Hi,

Thanks for the reply, this was realy an eyeopener for me. 

I changed the radajaxmanager into:

<UpdatedControls> 
      <telerik:AjaxUpdatedControl ControlID="FormatieRadgrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
      <telerik:AjaxUpdatedControl ControlID="FormatieRadgrid" LoadingPanelID="EditPeriodePanel" /> 
</UpdatedControls> 

Were EditPeriodePanel is the id of the panel of the usercontrol, and now its working fine!
I realy love the RadGrid!

Again, thanks a lot
-Ruud.
0
Puay Chai Tan
Top achievements
Rank 1
answered on 23 Jan 2011, 04:10 PM
Hi,

May I know how can I use the user control with update panel?
In my user control, I have two grid. I want to update that grid when the parent page is doing something(I means event).
Please help me out.

Regards.

0
Ruud
Top achievements
Rank 1
answered on 24 Jan 2011, 09:00 AM
Hmm, I'm not quite sure if I understand what you mean, but a RadGrid in a usercontrol doesn't sound as best practice.
You should provide more information (code?) of your problem.
Tags
Grid
Asked by
Ruud
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Ruud
Top achievements
Rank 1
Puay Chai Tan
Top achievements
Rank 1
Share this question
or