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?
<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?