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

radPanel breaks js call from grid row

3 Answers 35 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 1
Veteran
Morten asked on 09 Sep 2008, 11:23 PM
On an aspx page I have a dropdownlist and a usercontrol with a radgrid:

<asp:DropDownList runat="server" ID="ddlDate" AutoPostBack="true" />
<uc1:UcReports ID="UcReports1" runat="server" />

When ddlDate posts back the Rebind event of the RadGrid (on the user control "UcReports1") is fired.

The RadGrid has a GridTemplateColumn from where a RadWindow is opened:
<telerik:GridTemplateColumn Groupable="false">
<ItemTemplate><asp:Image runat="server" ID="iReport" /></ItemTemplate>
</telerik:GridTemplateColumn>

<telerik:RadWindowManager ID="rwm" runat="server">
<Windows>
<telerik:RadWindow ID="rw" runat="server" Height="600px" Width="900px" />
</Windows>
</telerik:RadWindowManager>

Code-behind (RadGrid.ItemDataBound):
iReport.Attributes.Add("onclick", String.Format("return ShowReport('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ReportId"), e.Item.ItemIndex))

Javascript:
<script type="text/javascript">
  function ShowReport(id, rowIndex){
    window.radopen("ReportDetails.aspx?id=" + id, "rw");
    return false;
  }
</script>

This all works fine, until I wrap the following in an RadAjaxPanel
<telerik:RadAjaxPanel runat="server" ID="ram">
<asp:DropDownList runat="server" ID="ddlDate" AutoPostBack="true" />
<uc1:UcReports ID="UcReports1" runat="server" />
</telerik:RadAjaxPanel>

When wrapped I get the following error when clicking the first instance of "iReport":
"Error: 'this._windows.length' is null or not an object"

Clicking the following instances of iReport produce the following error:
"Error: Sys.InvalidOperationException: Two components with the same id 'rw' can't be added to the application."

What am I doing wrong?

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 12 Sep 2008, 11:51 AM
Hi Morten71,

Could you please let me know if whether the problem persists if you are using asp UpdatePanel instead or RadAjaxPanel?
Also please review the following forum post which discusses similar error and provides possible workaround for it.

Best wishes,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Morten
Top achievements
Rank 1
Veteran
answered on 13 Sep 2008, 04:20 PM
I'm getting the same error message if I replace
<telerik:RadAjaxPanel runat="server" ID="ram">
with
 <asp:UpdatePanel runat="server" ID="up">
  <ContentTemplate>
0
Maria Ilieva
Telerik team
answered on 16 Sep 2008, 06:48 AM
Hi Morten,

Have you reviewed the solution provided in this forum post? Please test it on your side and let me know if it helps.

Kind regards,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Morten
Top achievements
Rank 1
Veteran
Answers by
Maria Ilieva
Telerik team
Morten
Top achievements
Rank 1
Veteran
Share this question
or