More in this section

Forums / Developing with Sitefinity / editing tabstrip pageview content.

editing tabstrip pageview content.

4 posts, 0 answered
  1. muhammad Shoaib Sharafat
    muhammad Shoaib Sharafat avatar
    1 posts
    Registered:
    22 Oct 2009
    22 Oct 2009
    Link to this post
    Hi,
    i want to know that how can we edit tabstrip pageview content when the tabstrip is used with user control. if it is not possible then how can i add tabstrip,multipageview and pageview in a tabstrip control under radcontrols in Add contols portion of a page or template.

    Also can i make site menu dynamically ie skip some pages or rename some pages or hide some pages in site menu used as a top menu bar.

    Regards
    Muhammad Shoaib.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    22 Oct 2009
    Link to this post
    Hi muhammad Shoaib Sharafat,

    i want to know that how can we edit tabstrip pageview content when the tabstrip is used with user control. if it is not possible then how can i add tabstrip,multipageview and pageview in a tabstrip control under radcontrols in Add contols portion of a page or template.

    You can do this only in Visual Studio or other code editor you use - declaretively or dynamically.  There is an option that allows you to create a custom control and edit it in page edit mode. It required creating of a custom control and designer for it. You may find the following discussion useful.

    Also can i make site menu dynamically ie skip some pages or rename some pages or hide some pages in site menu used as a top menu bar.

    You can rename or hide some pages by subscribing for ItemDataBound event of the SiteMenu control then getting the RadMenuItem as a DataItem. Note that if you hide any parent - root item, its childs will be also hidden.

    sample code

    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)
       {
           CmsSiteMapNode smNode = e.Item.DataItem as CmsSiteMapNode;
           if (smNode != null && e.Item.Text == "oldtext")
           {
            e.Item.Text = "newtext";
           }
       }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Zeeshan fawad
    Zeeshan fawad avatar
    4 posts
    Registered:
    05 Jun 2009
    26 Oct 2009
    Link to this post

     

    Hello Brenton,

    You need to create a custom control. For instance you could inherits from SimpleControl class.Then you need to create a control designer for your control. Your control designer should inherits from ControlDesigner class. In your control designer you should override LayoutTemplatePath and specify the path to your custom template for the designer basic tab. In this designer you should provide the ability for creating a new pages - respectively RadTabs. If you do not want these tabs to be a cms pages you need to create your custom data source which will be populated with the new data- persisting the tables.

    Generally in the designer you should provide the ability for a user to select the page, then you need to get the id of this page and under it, create a new RadTab.


    Can you  please give me a code example for
    you need to create a control designer for your control

     My requirement is not same.I want to make three tabs (using ascx control and add a tabstrip with three tabs, a multipage view and three pageviews). Then i place this control in each page and user can add edit/content of the pageview of a tab w.r. t the page.
    Regards
    Muhammad Shoaib

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    26 Oct 2009
    Link to this post
    Hi Zeeshan fawad,

    Can you  please give me a code example for
    you need to create a control designer for your control


    Below is  sample of creating ControlDesigner

    public class Class7 : ContentViewDesignerBase
    {
        public Class7()
        {
        }
     
        public override string DesignerTemplatePath
        {
            get
            {
                return "your template here";
            }
         
        }
    }

    Then you should use your designer in a custom control

    [ControlDesignerAttribute("Class7, App_Code")]

     My requirement is not same.I want to make three tabs (using ascx control and add a tabstrip with three tabs, a multipage view and three pageviews). Then i place this control in each page and user can add edit/content of the pageview of a tab w.r. t the page.


    Below is a sample of a similar control

          <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1">
               <Tabs>
                   <telerik:RadTab runat="server" Text="Tab1" PageViewID="Pageview1">
                   </telerik:RadTab>
                   <telerik:RadTab runat="server" Text="Tab2" PageViewID="Pageview2">
                   </telerik:RadTab>
                </Tabs>
           </telerik:RadTabStrip>
     <telerik:RadMultiPage id="RadMultiPage1" runat="server" SelectedIndex="0" Width="400">
      <telerik:RadPageView id="Pageview1" runat="server">
       <asp:Literal  ID="Literal1" runat="server" Text="tab1"></asp:Literal>
      </telerik:RadPageView>
      <telerik:RadPageView id="Pageview2" runat="server" CssClass="Tab2">
      <asp:Literal  ID="Literal2" runat="server"  Text="tab2"></asp:Literal>
      </telerik:RadPageView
    </telerik:RadMultiPage>

    It has two tabs and Literal control ( you can replace them with different control). In edit mode of the control you need to access both the Literal controls and change their text value.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered