I ran across a problem when dealing with a Telerik RadWindow. On my page, I had this definition:
<telerik:RadWindow ID=”MyWindow” runat=”server” Title=”Scott’s Window” VisibleOnPageLoad=”false” Behavior=”Close” EnableShadow=”true” Modal=”true”>
The problem is that when I opened the window, then closed it by using the “X” in the top right corner, and then opened the window again, the control would be bound twice. And not just the RadGrid I had in the control, the entire page would be duplicated.
I tried everything I could think of. I tried removing the extra control (there was one being loaded when opening the window again) in the RadWindow’s ContentContainer.Controls collection. I tried stopping the processing of the second page binding. I tried using the DestoryOnClose property. I tried going to lunch. Nothing worked.
So I cheated.
Instead of dealing with the mysterious double binding, I just removed the “X” from the menu bar by changing the Behavior property of the RadWindow:
This hid the close button, as well as the minimize and maximize buttons. I didn’t need them, and the users didn’t need them, and if you can’t perform the action that causes the error, you can’t cause the error.