I saw your demo on opening up an advanced RadEditor inside a RadWindow. For my purposes, I am using a RadGrid to display list of items that each contain a field to store html details about the item that needs to be able to be modified by the user when they update the item.
Due to space limitations, I do not have the room to display the full editor inside the edit item template for the grid. What I want to know is, would it be possible to implement the RadEditor in a RadWindow from within the edit item template of a grid?
In case that's confusing...a user click "edit" on an item in a grid...fills out all of the text fields, but then can launch the editor in a RadWindow to update the details before completing the update on the grid item.
I cut out some of the original grid code; however, the snippet below returns an error that DialogWindow does not exist in the current context. Before going any further I wanted to verify that there was no a limitation of the gridview that would prevent me from doing this...
Thanks,
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> |
| <telerik:radgrid id="RadGrid2" runat="server" allowfilteringbycolumn="True" allowpaging="True" |
| allowsorting="True" autogeneratedeletecolumn="True" autogenerateeditcolumn="True" |
| datasourceid="LinqDataSource2" gridlines="None" showgrouppanel="True" skin="WebBlue"> |
| <MasterTableView AutoGenerateColumns="False" DataKeyNames="FeedbackID" DataSourceID="LinqDataSource2" |
| CommandItemDisplay="Top" EditMode="PopUp"> |
| <EditFormSettings PopUpSettings-Modal="true"> |
| <PopUpSettings Modal="True"></PopUpSettings> |
| </EditFormSettings> |
| <Columns> |
| <telerik:GridTemplateColumn DataField="Details" DataType="System.String" HeaderText="Feedback Details" |
| SortExpression="Details" UniqueName="Details"> |
| <ItemTemplate> |
| <%--Nothing here yet--%> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <telerik:RadWindow OnClientShow="SetDialogContent" OnClientPageLoad="SetDialogContent" |
| NavigateUrl="EditorInWindow.aspx" runat="server" Behaviors="Maximize,Close,Move" |
| ID="DialogWindow" VisibleStatusbar="false" Width="800px" Modal="true" Height="700px" /> |
| <telerik:RadEditor ID="RadEditor1" EnableResize="false" runat="server" Width="460px" |
| Height="200px"> |
| <Tools> |
| <telerik:EditorToolGroup> |
| <telerik:EditorTool Name="RichEditor" Text="Open Advanced Editor" /> |
| </telerik:EditorToolGroup> |
| </Tools> |
| <Content> |
| <img src="../../Img/productLogoLight.gif" alt="product logo" /> |
| <ul> |
| <li><em>Single-file, drag-and-drop deployment</em></li> |
| <li><em>Built on top of ASP.NET AJAX</em></li> |
| </ul> |
| </Content> |
| </telerik:RadEditor> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings AllowDragToGroup="True"> |
| </ClientSettings> |
| </telerik:radgrid> |
| <script type="text/javascript"> |
| //<![CDATA[ |
| var editorContent = null; |
| Telerik.Web.UI.Editor.CommandList["RichEditor"] = function(commandName, editor, args) { |
| editorContent = editor.get_html(true); //get RadEditor content |
| $find("<%=DialogWindow.ClientID%>").show(); //open RadWindow |
| }; |
| function SetEditorContent(content) { |
| //set content to RadEditor on the mane page from RadWindow |
| $find("<%=RadEditor1.ClientID%>").set_html(content); |
| } |
| function SetDialogContent(oWnd) { |
| var contentWindow = oWnd.get_contentFrame().contentWindow; |
| if (contentWindow && contentWindow.setContent) { |
| window.setTimeout(function() { |
| //pass and set the content from the mane page to RadEditor in RadWindow |
| contentWindow.setContent(editorContent); |
| }, 500); |
| } |
| } |
| //]]> |
| </script> |
