[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

web form with rad editor and rad tabstrip

Posted on 2010-09-23
8
Medium Priority
?
1,566 Views
Last Modified: 2012-05-10
I have a form with a rad editor and rad tabstrip (with two tabs). I want a differnt rad editor to appear depending on what tab the users clicks on.  Could somebody tell me the best way to do this?
0
Comment
Question by:vbnetcoder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 7

Expert Comment

by:Utkarsh Kulkarni
ID: 33744173
What exactly you mean by different Rad Editor ?
Is it with Toolbar / UI ?
If its with Toolbar, you can specify the XML file path for it in Rad-Editor attribs.
If it is w.r.t. UI, then you will need to work on Skining part.
This might be helpful to you :
http://www.telerik.com/community/forums/aspnet/editor/skin-for-rad-editor-like-telerik-forum.aspx
http://www.telerik.com/help/aspnet-ajax/editor-css-classes-and-their-use.html 
0
 

Author Comment

by:vbnetcoder
ID: 33744224
I want one radeditor to show if one of the tabs is clicked and the other to show if the other tab is clicked.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 33744273
I don't understand your complexity here. I have this setup in a project. each tab host a different RadEditor and it is working correctly
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:vbnetcoder
ID: 33744374
emoreau:

Can you tell me how you are doing it?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 33745071
I don't have my project handy. I will show you some code tonight
0
 

Author Comment

by:vbnetcoder
ID: 33745116
Do i need a rad page view or multi view?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 33749864
I use RadPageView.
Here is the code (maybe a bith too much but at least you will not miss anything):

<%@ Page Language="vb" 
         AutoEventWireup="false" 
         CodeBehind="EditPage.aspx.vb" 
         Inherits="FGLWebSite.EditPage" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">
    <title>Edit Page</title>
    <link href="/App_Themes/Default/FGLWebSite.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    html, body,form { padding-bottom: 0; margin-bottom: 0; }

        .rade_toolZone tr
        {
            display: table-row !important;
        }
        .RadEditor
        {
            position: static !important;
        }
        .rade_editorModesCell
        {
            display: none !important;
        }
        .rade_editorModes
        {
            position: static !important;
        }
    </style>
</head>

<body>
    <form id="form1" runat="server">
    
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">    
    </telerik:RadScriptManager>

    <div>

        <script type="text/javascript">

            var editorInstance = null;
            
	        function CloseAndRebind()
	        {
		        GetRadWindow().Close();
		        GetRadWindow().BrowserWindow.refreshGrid(null);
	        }
    		
	        function GetRadWindow()
	        {
		        var oWindow = null;
		        if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
		        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)
    				
		        return oWindow;
	        }

	        function CancelEdit()
	        {
	            GetRadWindow().Close();		
	        }

	        function onTabSelected(sender, args) {
	            var selectedTab = args.get_tab().get_text();

	            var documentHeightFix = "45";
	            var documentHeight = document.documentElement.offsetHeight - documentHeightFix;

	            if (selectedTab == "English Text") {
	                var editor1 = $find("<%=txtDescriptionEn.ClientID%>");
	                editor1.setSize(editor1.get_element().style.width, documentHeight);
	            }
	            else if (selectedTab == "French Text") {
	            var editor2 = $find("<%=txtDescriptionFr.ClientID%>");
	            editor2.setSize(editor2.get_element().style.width, documentHeight);
	            }
	        }
	        
        </script>

        <telerik:RadTabStrip ID="RadTabStrip1" 
                             runat="server" 
                             SelectedIndex="0" 
                             MultiPageID="RadMultiPage1" 
                             OnClientTabSelected="onTabSelected">
            <Tabs>
                <telerik:RadTab Text="General Information" 
                    PageViewID="pvGeneralInfo" Selected="True" >
                </telerik:RadTab>
                <telerik:RadTab Text="English Text" PageViewID="pvEnglishText" >
                </telerik:RadTab>
                <telerik:RadTab Text="French Text" PageViewID="pvFrenchText" >
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Width="100%">
            <telerik:RadPageView ID="pvGeneralInfo" runat="server">
                <table id="Table3" cellspacing="1" cellpadding="1" border="0" class="module">
                    <tr>
                        <td>
                            Id
                        </td>
                        <td>
                            <asp:Label ID="lblID" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblTitle" runat="server" CssClass="text" Text="<%$ Resources:Resources, EditPage_Title %>"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="Label1" runat="server" CssClass="text" Text="<%$ Resources:Resources, en %>"
                                Width="24px"></asp:Label>
                            <asp:TextBox ID="txtPageTitleEn" runat="server" CssClass="textbox" Width="400px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqTitleEn" runat="server" ControlToValidate="txtPageTitleEn"
                                ErrorMessage="<%$ Resources:Resources, EditPage_TitleRequired %>" ForeColor="red"
                                SetFocusOnError="true" Text="*"></asp:RequiredFieldValidator>
                            <br />
                            <asp:Label ID="Label2" runat="server" CssClass="text" Text="<%$ Resources:Resources, fr %>"
                                Width="24px"></asp:Label>
                            <asp:TextBox ID="txtPageTitleFr" runat="server" CssClass="textbox" Width="400px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqTitleFr" runat="server" ControlToValidate="txtPageTitleFr"
                                ErrorMessage="<%$ Resources:Resources, EditPage_TitleRequired %>" ForeColor="red"
                                SetFocusOnError="true" Text="*"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" CssClass="text" Text="<%$ Resources:Resources, EditPage_MenuItem %>"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="Label4" runat="server" CssClass="text" Text="<%$ Resources:Resources, en %>"
                                Width="24px"></asp:Label>
                            <asp:TextBox ID="txtMenuTitleEN" runat="server" CssClass="textbox" Width="400px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqMenuItemEN" runat="server" SetFocusOnError="true"
                                ControlToValidate="TxtMenuTitleEN" Text="*" ForeColor="red" ErrorMessage="<%$ Resources:Resources, EditPage_MenuItemRequired %>"></asp:RequiredFieldValidator>
                            <br />
                            <asp:Label ID="Label5" runat="server" CssClass="text" Text="<%$ Resources:Resources, fr %>"
                                Width="24px"></asp:Label>
                            <asp:TextBox ID="txtMenuTitleFR" runat="server" CssClass="textbox" Width="400px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="reqMenuItemFR" runat="server" SetFocusOnError="true"
                                ControlToValidate="TxtMenuTitleFR" Text="*" ForeColor="red" ErrorMessage="<%$ Resources:Resources, EditPage_MenuItemRequired %>"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label9" runat="server" CssClass="text" Text="<%$ Resources:Resources, EditPage_AcceptURL %>"></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="Label10" runat="server" CssClass="text" Text="<%$ Resources:Resources, en %>"
                                Width="24px"></asp:Label>
                            <asp:TextBox ID="txtURLAcceptPageEN" runat="server" CssClass="textbox" Width="400px"></asp:TextBox>
                            <br />
                            <asp:Label ID="Label11" runat="server" CssClass="text" Text="<%$ Resources:Resources, fr %>"
                                Width="24px"></asp:Label>
                            <asp:TextBox ID="txtURLAcceptPageFR" runat="server" CssClass="textbox" Width="400px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label6" runat="server" CssClass="text" Text="<%$ Resources:Resources, EditPage_Visible %>"></asp:Label>
                        </td>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label7" runat="server" CssClass="text" Text="<%$ Resources:Resources, EditPage_VisibleFrom %>"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="dtpVisibleFrom" Runat="server" Culture="English (United States)">
                                            <dateinput runat="server" dateformat="yyyy/MM/dd">
                            </dateinput>
                                            <calendar runat="server" usecolumnheadersasselectors="False" userowheadersasselectors="False" viewselectortext="x">
                            </calendar>
                                            <datepopupbutton hoverimageurl="" imageurl="" />
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Label8" runat="server" CssClass="text" Text="<%$ Resources:Resources, EditPage_VisibleTo %>"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="dtpVisibleTo" Runat="server" Culture="English (United States)">
                                            <dateinput runat="server" dateformat="yyyy/MM/dd">
                            </dateinput>
                                            <calendar runat="server" usecolumnheadersasselectors="False" userowheadersasselectors="False" viewselectortext="x">
                            </calendar>
                                            <datepopupbutton hoverimageurl="" imageurl="" />
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Last Update:
                        </td>
                        <td>
                            <asp:TextBox ID="txtLastUpdate" runat="server" TabIndex="4" Enabled="False"></asp:TextBox>
                            by
                            <asp:TextBox ID="txtLastUpdater" runat="server" TabIndex="4" Width="200px" Enabled="False"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            URL:
                        </td>
                        <td>
                            <asp:TextBox ID="txtURLEn" runat="server" TabIndex="4" Width="400px" Enabled="False"></asp:TextBox>
                            <br />
                            <asp:TextBox ID="txtURLFr" runat="server" TabIndex="4" Width="400px" Enabled="False"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btnUpdate" Text="Update" runat="server" OnClick="btnUpdate_Click">
                            </asp:Button>&nbsp;
                            <button onclick="CancelEdit()" type="button" causesvalidation="false">
                            Cancel
                            </button>
                        </td>
                    </tr>
                </table>
            </telerik:RadPageView>
            
            <telerik:RadPageView ID="pvEnglishText" runat="server">
                <telerik:RadEditor ID="txtDescriptionEn" 
                                   Width="100%"
                                   runat="server" 
                                   StripFormattingOnPaste="AllExceptNewLines"
                                   StripFormattingOptions="NoneSupressCleanMessage, MSWord, MSWordNoFonts, MSWordRemoveAll"
                                   >
                                   <%--OnClientLoad="OnClientLoad"--%> 
                    <DocumentManager DeletePaths="~/Docs" MaxUploadFileSize="1204800" UploadPaths="~/Docs"
                        ViewPaths="~/Docs" />
                    <Content>
                    </Content>
                    <ImageManager DeletePaths="~/Images" UploadPaths="~/Images" ViewPaths="~/Images" />
                </telerik:RadEditor>
            </telerik:RadPageView>
            
            <telerik:RadPageView ID="pvFrenchText" runat="server">
                <telerik:RadEditor ID="txtDescriptionFr" 
                                   Width="100%"
                                   runat="server" 
                                   StripFormattingOnPaste="AllExceptNewLines"
                                   StripFormattingOptions="NoneSupressCleanMessage, MSWord, MSWordNoFonts, MSWordRemoveAll"
                                   SpellCheckSettings-DictionaryLanguage="fr-FR">
                                   <%--OnClientLoad="OnClientLoad" --%>
                    <DocumentManager DeletePaths="~/Docs" MaxUploadFileSize="1204800" UploadPaths="~/Docs"
                        ViewPaths="~/Docs" />
                    <Content>
                    </Content>
                    <ImageManager DeletePaths="~/Images" UploadPaths="~/Images" ViewPaths="~/Images" />
                    <SpellCheckSettings DictionaryLanguage="fr-fr"></SpellCheckSettings>
                </telerik:RadEditor>
            </telerik:RadPageView>

        </telerik:RadMultiPage>
        <br />
        <asp:Label ID="InjectScript" runat="server"></asp:Label>

    </div>
    </form>
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:vbnetcoder
ID: 33750016
ty
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question