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

Close RadWindow - Behaviors="Close"

3 Answers 245 Views
Window
This is a migrated thread and some comments may be shown as answers.
Daniela
Top achievements
Rank 1
Daniela asked on 28 Dec 2010, 10:26 PM
We have a problem with the close of the RadWindow about Telerik-function (Behaviors="Close").

We use a RadWindow with the Attribute "Behaviors=Close"

<telerik:RadWindow ID="RadWindowProgramCategory" EnableShadow="true" Behaviors="Close" runat="server">
......
  <asp:Button ID="ButtonCloseWindow"  runat="server" Text="Close" OnClick="OnCloseWindow" />
.....
</telerik:RadWindow>

The RadWindow open with the button "ButtonOpenRadWindow".

<asp:Button ID="ButtonOpenRadWindow" Text="Hinzufügen" ToolTip="Hinzufügen" runat="server" OnClick="OnOpenRadWindow"></asp:Button>
  
    protected void OnOpenRadWindow(object sender, EventArgs args)
    {
      AllVirtualCategories.SelectedIndex = -1;
      UpdateCatagoryFields();
  
      RadWindowProgramCategory.Title = App_LocalResources.CategoryDataControl_ascx.RadWindow_TitleAddCategory;
      RadWindowProgramCategory.VisibleOnPageLoad = true;
      RadWindowProgramCategory.Enabled = true;
      RadWindowProgramCategory.Modal = true;
      RadWindowProgramCategory.AutoSize = true;
  
      String radWindowScript = JavaScript.GetJsOpenWindowIncCloseWindow(RadWindowProgramCategory, "");
      ScriptManager.RegisterStartupScript(RadWindowProgramCategory, this.GetType(), "RadWindowProgramCategory", radWindowScript, true);
    }

Thge Radwindow must open after the Postback. That works with
RadWindowProgramCategory.VisibleOnPageLoad = false;

We can close the Window about a another button and a server-side function.
protected void OnCloseWindow(object sender, EventArgs args)
{
  RadWindowProgramCategory.VisibleOnPageLoad = false;
  RadWindowProgramCategory.Enabled = false;
}

When we close the RadWindow about icon on RadWindow Behaviors="Close" an we again a postback then opens the window again.

how can we change this?

Best regards
Daniela Fischer

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 30 Dec 2010, 12:24 PM
Hello Daniela,


This is expected behaviour since the RadWindow preserves ViewState after postback. In your case, setting EnableViewState property of RadWindow will work for you.

And also refer the following forum which discusses similar scenario.
Stop RadWindow from always loading on page postback

Thanks,
Princy.
0
Daniela
Top achievements
Rank 1
answered on 02 Jan 2011, 08:26 PM
hello Princy,

thank you for your feedback.

this is not the solution to my problem.
I want the window remains visible in a postback. but only when a postback is triggered within the window. if I close the windows on the icon (see screenshot above) to open any more windows.

Icon for the RadWindow
RadWindowProgramCategory.Behaviors = Telerik.Web.UI.WindowBehaviors.Close;

Its own button I can control when I set the property

     VisibleOnPageLoad = false;

Behind Telerik generated javascript at "WindowBehaviors.Close" I can not write their own code.

There is a solution for this?
I hope I could describe the problem well. if not then I create an example.

Regards Dani
0
Fiko
Telerik team
answered on 03 Jan 2011, 09:31 AM
Hello Daniela,

I recommend you to wrap the content of the RadWindow in a RadAjaxPanel and set the RadWindow's EnableViewState="false" (as Princy suggested). In this case, any postback initiated inside the content of the RadWindow control will not affect the window itself.

Greetings,
Fiko
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Window
Asked by
Daniela
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Daniela
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or