I've seen a few different posts close to what I am trying to do, but I can't get any of them working. Basically, I have a grid on my parent page with a button above it. If the user clicks the button, it opens a RadWindow so the user can "Create new". If the user selected an item from the grid, it opens the RadWindow and loads it with the data so the user can Edit the item.
When the user clicks the Save button IN the RadWindow, It calls a service to Save the Record, then I need it to CLOSE the RADWINDOW, and REFRESH the RadGrid on the Opening form. To close the RadWindow, I am trying:
//RadWindowManager1.Windows[0].VisibleOnPageLoad = true;
//RadWindowManager1.Windows[0].Visible = false;
But I get Javascript Errors. I tried different variations of the above approach and get Javascript errors most of the time. I tried Calling a Javascript Method to close the window. It seems to work sometimes, but not all of the time:
ScriptManager.RegisterClientScript(.....) which tries to find the RadWindow and close it...
here is most of my current code in the Save Method:
I like these controls for the most part, but the RadWindow seems to give me the most difficulty currently...ugh.
thanks
mark
When the user clicks the Save button IN the RadWindow, It calls a service to Save the Record, then I need it to CLOSE the RADWINDOW, and REFRESH the RadGrid on the Opening form. To close the RadWindow, I am trying:
//RadWindowManager1.Windows[0].VisibleOnPageLoad = true;
//RadWindowManager1.Windows[0].Visible = false;
But I get Javascript Errors. I tried different variations of the above approach and get Javascript errors most of the time. I tried Calling a Javascript Method to close the window. It seems to work sometimes, but not all of the time:
ScriptManager.RegisterClientScript(.....) which tries to find the RadWindow and close it...
here is most of my current code in the Save Method:
<P> if (isUpdate)<BR> {<BR><BR> talentCredit.UpdateTalentCredit(credit);<BR> }<BR> else<BR> {<BR> <BR> talentCredit.CreateTalentCredit(credit);</P> <P> }<BR> SiteMaster masterPage = (SiteMaster)Page.Master;<BR> masterPage.SetAlertMessage("Credit has been Saved.", "green");</P> <P> <BR> //Reload the Credits Grid on the Page that opened the RadWindow...<BR> loadCredits(talentId);<BR> radgridCredits.DataBind();<BR><BR> //Now CLOSE the RadWindow...<BR> RadWindowManager1.Windows[0].VisibleOnPageLoad = true;<BR> RadWindowManager1.Windows[0].Visible = false;</P>
I get Javascript errors if I try to use the RadWindowManager1 approach, but if I try this on other Pages, this approach works fine....
RadWindowManager HTML:
<telerik:RadWindowManager ID="RadWindowManager1" Behaviors="Close" runat="server"><BR> <Windows><BR> <telerik:RadWindow ID="radWinAddCredit" runat="server"<BR> Modal="true" AutoSize="true" Title="Add/Edit Credit" VisibleStatusbar="false"<BR> VisibleOnPageLoad="False" Skin="WebBlue" Height="300px" ShowContentDuringLoad="False"<BR> Width="375px" Behaviors="Close"><BR> <ContentTemplate><BR> <table class="form" width="100%"><BR> <tr><BR> <td class="formLabel-RightAlign" align="left"><BR> Craft<BR> </td><BR> <td><BR> <telerik:RadComboBox ID="cboCrafts" Skin="WebBlue" Width="205px" ZIndex="5000" MarkFirstMatch="true"<BR> EmptyMessage="Type to Select..." runat="server"><BR> </telerik:RadComboBox><BR> <asp:RequiredFieldValidator ID="valCreditCrafts" ControlToValidate="cboCrafts" runat="server"<BR> ErrorMessage="Required" InitialValue="Type to Select..." ValidationGroup="CreditGroup"></asp:RequiredFieldValidator><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Title<BR> </td><BR> <td><BR> <telerik:RadComboBox ID="cboShowTitles" Skin="WebBlue" ZIndex="5000" Width="205px"<BR> EnableAutomaticLoadOnDemand="true" EmptyMessage="Type to Search..." MarkFirstMatch="true"<BR> runat="server" EnableLoadOnDemand="True" ItemsPerRequest="100"><BR> <WebServiceSettings Method="GetShowTitles" Path="SERVICE PATH HERE" /><BR> </telerik:RadComboBox><BR> <asp:RequiredFieldValidator ID="valCreditShows" ControlToValidate="cboShowTitles"<BR> runat="server" ErrorMessage="Required" InitialValue="Type to Search..." ValidationGroup="CreditGroup"></asp:RequiredFieldValidator><BR> </td><BR> </tr><BR> <tr><BR> <td class="formLabel-RightAlign"><BR> Comment<BR> </td><BR> <td><BR> <asp:TextBox ID="txtCreditComment" CssClass="textFields" runat="server" Width="200px"></asp:TextBox><BR> </td><BR> </tr><BR> <tr><BR> <td align="right" colspan="2"><BR> <telerik:RadButton ID="btnSaveCredit" Skin="WebBlue" runat="server" Text="Save" ValidationGroup="CreditGroup"<BR> OnClick="btnSaveCredit_Click"><BR> </telerik:RadButton><BR> </td><BR> </tr><BR> </table><BR> </ContentTemplate><BR> </telerik:RadWindow><BR> </Windows><BR> </telerik:RadWindowManager> I like these controls for the most part, but the RadWindow seems to give me the most difficulty currently...ugh.
thanks
mark