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> |
| <telerik:RadWindowManager ID="RadWindowManager1" runat="server" ShowContentDuringLoad="false" |
| VisibleStatusbar="false" ReloadOnShow="true" Skin="Black"> |
| <Windows> |
| <telerik:RadWindow ID="PristineWindow" Behaviors="Close" OnClientClose="OnClientClose" VisibleTitlebar = "true" |
| NavigateUrl="http://www.pristine.com" Width="610px" Height="590px" Modal="true" Title="Access Pristine" KeepInScreenBounds="true" > |
| </telerik:RadWindow> |
| </Windows> |
| </telerik:RadWindowManager> |
| <telerik:RadListView ID="AListGrid" runat="server" AllowPaging="true" PageSize="10" |
| AllowCustomPaging="True" ItemPlaceholderID="PropertiesContianer"> |
| <LayoutTemplate> |
| <fieldset id="RadListView1"> |
| <div class="proGridTopPager"> |
| <telerik:RadDataPager ID="RadDataPager2" runat="server" Style="border: none;" SkinID="ListViewSkin" |
| AllowSEOPaging="true" SEOPagingQueryPageKey="Page"> |
| <Fields> |
| <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> |
| <telerik:RadDataPagerButtonField FieldType="Numeric" /> |
| <telerik:RadDataPagerButtonField FieldType="NextLast" /> |
| </Fields> |
| </telerik:RadDataPager> |
| </div> |
| <asp:PlaceHolder ID="PropertiesContianer" runat="server" /> |
| <telerik:RadDataPager ID="RadDataPager1" runat="server" Style="border: none;" SkinID="ListViewSkin" |
| AllowSEOPaging="true" SEOPagingQueryPageKey="Page"> |
| <Fields> |
| <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> |
| <telerik:RadDataPagerButtonField FieldType="Numeric" /> |
| <telerik:RadDataPagerButtonField FieldType="NextLast" /> |
| </Fields> |
| </telerik:RadDataPager> |
| </fieldset> |
| </LayoutTemplate> |
| <ItemTemplate> |
| <osl:descContent ID="lbltest" runat="server" Text="" /> |
| </ItemTemplate> |
| </telerik:RadListView> |
| Private Sub AListGrid_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadListViewItemEventArgs) Handles AListGrid.ItemDataBound |
| If (TypeOf (e.Item) Is RadListViewDataItem) Then |
| Dim dataBoundItem = DirectCast(e.Item, RadListViewDataItem) |
| Dim atest = DirectCast(dataBoundItem.FindControl("lbltest"), descContent) |
| atest.Text = "test" |
| End If |
| End Sub |
I have a page that has a RadWindowManager on it.
I have a button on that page and below is the code in the Click event of that button.
It opens the page EmailSend.aspx in a RadWindow.
RadWindow window = new RadWindow();
window.ID = "EmailSend";
window.NavigateUrl = "/EmailSend.aspx";
window.VisibleOnPageLoad = true;
window.Behaviors = Telerik.Web.UI.WindowBehaviors.Close;
window.Height = 800;
window.Width = 960;
RadWindowManager1.VisibleOnPageLoad = true;
window.Title = "Email Release";
RadWindowManager1.Windows.Add(window);
Page EmailSend.aspx is a form the user types all the information into that they want emailed.
When the user clicks the Send Button on this form, I have code that inserts the email information into the database.
After this code executes, I have the following line: (I want the window to close when the User clicks Send)
ScriptManager.RegisterStartupScript(this, GetType(), "EmailSend", "CloseRadWindow();", true);
In the Source of EmailSend.aspx, I have the following in the Send button.
<asp:Button ID="btnSend" runat="server" Text="Send" OnClick="btnSend_Click" OnClientClick="CloseWnd();return false;" />
I also have the following function in the Source of EmailSend.aspx
<script type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseWnd() {
GetRadWindow().close();
}
</script>
This kind of works but I must be missing something. I read that RadWindows don't close, they just hide themselves. I think this is the problem I am having. The first time I click the button that opens EmailSend.aspx in a RadWindow, I click Send and it runs my code and closes. If I open it a second time, I have to click Send twice for it to close. If I open it a third time, i have to click Send three times for it to close. What am I doing wrong?????
How do display multiple columns in the load by demand example?
The following code from the multi-col does not display the data.
Do I have to bind the datatable to the combox for this to work.
It seems the databinding to the radcombo takes a while.. thanks in advance.
<
HeaderTemplate>
<table style="width: 100%; text-align: left">
<tr>
<td style="width: 125px;">
Company Name
</td>
<td style="width: 125px;">
City
</td>
<td style="width: 125px;">
Title
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width: 100%; text-align: left">
<tr>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "CompanyName") %>
</td>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "City") %>
</td>
<td style="width: 125px;">
<%
# DataBinder.Eval(Container.DataItem, "ContactTitle") %>
</td>
</tr>
</table>
</ItemTemplate>