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

Calling ContentTemplated RadWindow Open from CodeBehind

1 Answer 163 Views
Window
This is a migrated thread and some comments may be shown as answers.
race maine
Top achievements
Rank 1
race maine asked on 17 Feb 2011, 07:31 AM
I have a situation that I need some answers for please. I am working with the RadWindow control using the Contenttemplate. When my RadGrid is in EditMode, and user makes a selection from a contained dropdownlist, I would like to PopUp the RadWindow at that point showing user adding  options to help further filter data. When user clicks to close the Radwindow, I want to return to my EditMode RadGrid displaying the selected options in my RadGrid Textbox. 
 
My question is, how do I get my radwindow(content template) to display from codebehind.  

     <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Width="250"  Height="536" KeepInScreenBounds="true" Modal="true"  Behaviors="Minimize, Move, Resize, Maximize" Left="580" Top="-8" EnableShadow="true">
 
 <ContentTemplate>
 
 <asp:Panel ID="PnlUserRoleList">
<asp:CheckBoxList ID="UserRoleCheckBoxList" runat="server" Width="60%" />
 <asp:Button ID="btnAddselected" Text="AddItems" runat="server" />
<asp:Button ID="btnCancel" Text="Cancel" runat="server" />
</asp:Panel>
 </ContentTemplate>
 
 </telerik:RadWindow>

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 22 Feb 2011, 10:40 AM
Hello race,

You can use one of the following approaches, based on your exact scenario:

1) In the server handler, set VisibleOnPageLoad="true" for the RadWindow. After that set the property again when needed or wrap the RadWindow in a RadWindowManager with EnableViewState="false". This is the easier manner to achieve a single opening of the RadWindow from the code-behind.

2) Write a javascript function which opens the RadWindow and then execute this script from the server in the server handler, e.g as explained below:

http://blogs.telerik.com/blogs/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx

In case you need further assistance, please prepare a sample , fully runnable reproduction demo (use a fake programmatic datasource for the grid, no need for database, complex custom logic, etc), open a new support ticket and send it to us along with detailed reproduction steps and explanations and we will modify it in order to meet your requirements so that you will be then able to apply the same logic in your original application.
 

Greetings,
Svetlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Window
Asked by
race maine
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or