I have a RadGrid that uses a user control - in the user control ascx I need to pop up a modal RadWindow on a radioclick for some more row data. The problem is the the RadWindow seems to be stuck on the first row no matter what gridrow I click the button. I load the RadWindow elements from the user control code behind on Item binding just like I load each row. But it seems the RadWindow can't function inside this user control - has anyone done this and got it to work?
In the ascx grid user control:
<telerik:RadWindow ID="PlanPopup" runat="server" Height="420px" Width="850px" Modal="true">
<ContentTemplate>
<script language="javascript" type="text/javascript">
function makenew(url) {
window.open(url, "blank", "scrollbars=yes,resizable=yes,width=500,height=500")
}
</script>
<table style="width: 800px; height: 350px">
<tr>
<td class="tdSilver" colspan="3">Impact Assessment Review - <a href="javascript:makenew('/IRAP/repImpacts.aspx')">Impact Assessment Guidance</a></td>
</tr>
<tr>
<td><asp:label id="lblQNumN1" Runat="server">1</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN1" Runat="server" >Does the environment store or touch Wells Fargo </asp:label><span style="color: red"> *</span><br />
<asp:label id="lblQN1Cont" Runat="server">Confidential or Restricted data?</asp:label>
</td>
<td><asp:radiobuttonlist id="radConfidential" Visible="true" runat="server" RepeatLayout="Flow" CssClass="ispaCheckBoxes" RepeatDirection="Horizontal">
<asp:ListItem Value="True">Yes     </asp:ListItem>
<asp:ListItem Value="False" >No</asp:ListItem>
</asp:radiobuttonlist></td>
</tr>
<tr class="altRow">
<td><asp:label id="lblQNumN2" Runat="server" >2</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN2" Runat="server" >Is the environment externally facing or vendor hosted?</asp:label><span style="color: red"> *</span></td>
<td><asp:radiobuttonlist id="radExternalFacingVendorHosted" Visible="true" runat="server" RepeatLayout="Flow" CssClass="ispaCheckBoxes" RepeatDirection="Horizontal">
<asp:ListItem Value="True">Yes     </asp:ListItem>
<asp:ListItem Value="False" >No</asp:ListItem>
</asp:radiobuttonlist></td>
</tr>
<tr>
<td><asp:label id="lblQNumN3" Runat="server">3</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN3" Runat="server">Would a compromise of this enviroment result in loss of </asp:label><br />
<asp:label id="lblQN3Cont" Runat="server">availabilty to either WF customers or employees?</asp:label><span style="color: red"> *</span>
</td>
<td ><asp:radiobuttonlist id="radCompromiseAvail" Visible="true" runat="server" RepeatLayout="Flow" CssClass="ispaCheckBoxes" RepeatDirection="Horizontal">
<asp:ListItem Value="True">Yes     </asp:ListItem>
<asp:ListItem Value="False" >No</asp:ListItem>
</asp:radiobuttonlist></td>
</tr>
<tr>
<td><asp:label id="lblQNumN4" Runat="server">4</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN4" Runat="server">Would a compromise of this environment result in </asp:label><br />
<asp:label id="lblQN4Cont" Runat="server">loss of physical assets or revenues?</asp:label><span style="color: red"> *</span>
</td>
<td ><asp:radiobuttonlist id="radCompromiseLoss" Visible="true" runat="server" RepeatLayout="Flow" CssClass="ispaCheckBoxes" RepeatDirection="Horizontal">
<asp:ListItem Value="True">Yes     </asp:ListItem>
<asp:ListItem Value="False" >No</asp:ListItem>
</asp:radiobuttonlist></td>
</tr>
<tr class="altRow">
<td><asp:label id="lblQNumN5" Runat="server">5</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN5" Runat="server" >Please select the overall reputational impact:</asp:label><span style="color: red"> *</span></td>
<td><asp:DropDownList ID="ddlReputationalImpact" DataSourceID="SqlDataSource3" DataTextField="rskImpact" DataValueField="rskImpactID" runat="server" Width="212px">
</asp:DropDownList >
</td>
</tr>
<tr>
<td style="vertical-align: top"><asp:label id="lblQNumN6" Runat="server">6</asp:label></td>
<td style="width: 350px; vertical-align: top;"><asp:label id="lblQN6" Runat="server">Please add notes justifying the impact assessments entries:</asp:label><br/>
<asp:label id="lblQN6Cont" Runat="server">(Limited to 2,000 Characters)</asp:label><span style="color: red"> *</span>
</td>
<td style="vertical-align: top"><asp:TextBox id="txtNotesJustification" runat="server" width="100%" TextMode="MultiLine" Height="135px" MaxLength="2000"></asp:TextBox>
</td>
</tr>
<tr><td colspan="3" style="text-align: center">
<asp:Button ID="Button1" Text="Save" runat="server"/>
</td></tr>
</table>
</ContentTemplate>
</telerik:RadWindow>
<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="False" VisibleStatusbar="False"
ReloadOnShow="True" runat="server" EnableShadow="True">
<Windows>
<telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Resize, Close, Move" OnClientClose="OnClientClose"
NavigateUrl="SiteReviewPreTabs/SiteReviewPre_Reviews_NewPlanQuestions.aspx" AutoSize="True" Behavior="Resize, Close, Move" Modal="True">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<script type="text/javascript">
function openWin() {
var oWnd = radopen("SiteReviewPreTabs/SiteReviewPre_Reviews_NewPlanQuestions.aspx", "RadWindow1");
}
function OnClientClose(oWnd, args) {
//get the transferred arguments
var arg = args.get_argument();
//if (arg) {
// var cityName = arg.cityName;
// var seldate = arg.selDate;
// $get("order").innerHTML = "You chose to fly to <strong>" + cityName + "</strong> on <strong>" + seldate + "</strong>";
}
function onPlanChanged(rdoClicked) {
var oWnd = $find("<%= PlanPopup.ClientID %>");
oWnd.show();
}
</script>
In the ascx.cs:
protected void ReviewDetails_DataBinding(object sender, EventArgs e)
{
ddlReputationalImpact.SelectedIndex = -1;
ddlReputationalImpact.DataBind();
ddlReputationalImpact.ClearSelection();
SetSafeDropDownValue(ddlReputationalImpact, GetString(DataBinder.Eval(DataItem, "impactAssRskImpactID")));
if (DataBinder.Eval(DataItem, "impactAssTouchConfData") != DBNull.Value)
radConfidential.SelectedValue = GetString(DataBinder.Eval(DataItem, "impactAssTouchConfData"));
if (DataBinder.Eval(DataItem, "impactAssExtFacing") != DBNull.Value)
radExternalFacingVendorHosted.SelectedValue =
GetString(DataBinder.Eval(DataItem, "impactAssExtFacing"));
if (DataBinder.Eval(DataItem, "impactAssLossAvail") != DBNull.Value)
radCompromiseAvail.SelectedValue = GetString(DataBinder.Eval(DataItem, "impactAssLossAvail"));
if (DataBinder.Eval(DataItem, "impactAssLossAssets") != DBNull.Value)
radCompromiseLoss.SelectedValue = GetString(DataBinder.Eval(DataItem, "impactAssLossAssets"));
}
In the ascx grid user control:
<telerik:RadWindow ID="PlanPopup" runat="server" Height="420px" Width="850px" Modal="true">
<ContentTemplate>
<script language="javascript" type="text/javascript">
function makenew(url) {
window.open(url, "blank", "scrollbars=yes,resizable=yes,width=500,height=500")
}
</script>
<table style="width: 800px; height: 350px">
<tr>
<td class="tdSilver" colspan="3">Impact Assessment Review - <a href="javascript:makenew('/IRAP/repImpacts.aspx')">Impact Assessment Guidance</a></td>
</tr>
<tr>
<td><asp:label id="lblQNumN1" Runat="server">1</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN1" Runat="server" >Does the environment store or touch Wells Fargo </asp:label><span style="color: red"> *</span><br />
<asp:label id="lblQN1Cont" Runat="server">Confidential or Restricted data?</asp:label>
</td>
<td><asp:radiobuttonlist id="radConfidential" Visible="true" runat="server" RepeatLayout="Flow" CssClass="ispaCheckBoxes" RepeatDirection="Horizontal">
<asp:ListItem Value="True">Yes     </asp:ListItem>
<asp:ListItem Value="False" >No</asp:ListItem>
</asp:radiobuttonlist></td>
</tr>
<tr class="altRow">
<td><asp:label id="lblQNumN2" Runat="server" >2</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN2" Runat="server" >Is the environment externally facing or vendor hosted?</asp:label><span style="color: red"> *</span></td>
<td><asp:radiobuttonlist id="radExternalFacingVendorHosted" Visible="true" runat="server" RepeatLayout="Flow" CssClass="ispaCheckBoxes" RepeatDirection="Horizontal">
<asp:ListItem Value="True">Yes     </asp:ListItem>
<asp:ListItem Value="False" >No</asp:ListItem>
</asp:radiobuttonlist></td>
</tr>
<tr>
<td><asp:label id="lblQNumN3" Runat="server">3</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN3" Runat="server">Would a compromise of this enviroment result in loss of </asp:label><br />
<asp:label id="lblQN3Cont" Runat="server">availabilty to either WF customers or employees?</asp:label><span style="color: red"> *</span>
</td>
<td ><asp:radiobuttonlist id="radCompromiseAvail" Visible="true" runat="server" RepeatLayout="Flow" CssClass="ispaCheckBoxes" RepeatDirection="Horizontal">
<asp:ListItem Value="True">Yes     </asp:ListItem>
<asp:ListItem Value="False" >No</asp:ListItem>
</asp:radiobuttonlist></td>
</tr>
<tr>
<td><asp:label id="lblQNumN4" Runat="server">4</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN4" Runat="server">Would a compromise of this environment result in </asp:label><br />
<asp:label id="lblQN4Cont" Runat="server">loss of physical assets or revenues?</asp:label><span style="color: red"> *</span>
</td>
<td ><asp:radiobuttonlist id="radCompromiseLoss" Visible="true" runat="server" RepeatLayout="Flow" CssClass="ispaCheckBoxes" RepeatDirection="Horizontal">
<asp:ListItem Value="True">Yes     </asp:ListItem>
<asp:ListItem Value="False" >No</asp:ListItem>
</asp:radiobuttonlist></td>
</tr>
<tr class="altRow">
<td><asp:label id="lblQNumN5" Runat="server">5</asp:label></td>
<td style="width: 350px"><asp:label id="lblQN5" Runat="server" >Please select the overall reputational impact:</asp:label><span style="color: red"> *</span></td>
<td><asp:DropDownList ID="ddlReputationalImpact" DataSourceID="SqlDataSource3" DataTextField="rskImpact" DataValueField="rskImpactID" runat="server" Width="212px">
</asp:DropDownList >
</td>
</tr>
<tr>
<td style="vertical-align: top"><asp:label id="lblQNumN6" Runat="server">6</asp:label></td>
<td style="width: 350px; vertical-align: top;"><asp:label id="lblQN6" Runat="server">Please add notes justifying the impact assessments entries:</asp:label><br/>
<asp:label id="lblQN6Cont" Runat="server">(Limited to 2,000 Characters)</asp:label><span style="color: red"> *</span>
</td>
<td style="vertical-align: top"><asp:TextBox id="txtNotesJustification" runat="server" width="100%" TextMode="MultiLine" Height="135px" MaxLength="2000"></asp:TextBox>
</td>
</tr>
<tr><td colspan="3" style="text-align: center">
<asp:Button ID="Button1" Text="Save" runat="server"/>
</td></tr>
</table>
</ContentTemplate>
</telerik:RadWindow>
<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="False" VisibleStatusbar="False"
ReloadOnShow="True" runat="server" EnableShadow="True">
<Windows>
<telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Resize, Close, Move" OnClientClose="OnClientClose"
NavigateUrl="SiteReviewPreTabs/SiteReviewPre_Reviews_NewPlanQuestions.aspx" AutoSize="True" Behavior="Resize, Close, Move" Modal="True">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
<script type="text/javascript">
function openWin() {
var oWnd = radopen("SiteReviewPreTabs/SiteReviewPre_Reviews_NewPlanQuestions.aspx", "RadWindow1");
}
function OnClientClose(oWnd, args) {
//get the transferred arguments
var arg = args.get_argument();
//if (arg) {
// var cityName = arg.cityName;
// var seldate = arg.selDate;
// $get("order").innerHTML = "You chose to fly to <strong>" + cityName + "</strong> on <strong>" + seldate + "</strong>";
}
function onPlanChanged(rdoClicked) {
var oWnd = $find("<%= PlanPopup.ClientID %>");
oWnd.show();
}
</script>
In the ascx.cs:
protected void ReviewDetails_DataBinding(object sender, EventArgs e)
{
ddlReputationalImpact.SelectedIndex = -1;
ddlReputationalImpact.DataBind();
ddlReputationalImpact.ClearSelection();
SetSafeDropDownValue(ddlReputationalImpact, GetString(DataBinder.Eval(DataItem, "impactAssRskImpactID")));
if (DataBinder.Eval(DataItem, "impactAssTouchConfData") != DBNull.Value)
radConfidential.SelectedValue = GetString(DataBinder.Eval(DataItem, "impactAssTouchConfData"));
if (DataBinder.Eval(DataItem, "impactAssExtFacing") != DBNull.Value)
radExternalFacingVendorHosted.SelectedValue =
GetString(DataBinder.Eval(DataItem, "impactAssExtFacing"));
if (DataBinder.Eval(DataItem, "impactAssLossAvail") != DBNull.Value)
radCompromiseAvail.SelectedValue = GetString(DataBinder.Eval(DataItem, "impactAssLossAvail"));
if (DataBinder.Eval(DataItem, "impactAssLossAssets") != DBNull.Value)
radCompromiseLoss.SelectedValue = GetString(DataBinder.Eval(DataItem, "impactAssLossAssets"));
}