+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Page SiteMap inside the module Control Panel

Page SiteMap inside the module Control Panel

6 posts, 0 answered
  1. Nauman
    Nauman avatar
    35 posts
    Registered:
    28 Jul 2008
    25 Feb 2010
    Link to this post
    Hi

    I am creating a module inside the sitefinity, i want to add the page sitemap in side the control panel of the module, as sitefinity done in the page Section. On clicking on any node i want to get the event & node details.


    Please suggest

    Thanks
    Nauman Ahmed
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    25 Feb 2010
    Link to this post
    Hello Nauman,

    1. The SiteMap control in pages section is located to the command panel
    2.You need to create a custom control and bind it to SiteMapDataSource control or to a list of ICms pages. You can use GetPages method of CmsManager object to create the list.
    3. You can use NodeClick event of RadTreeView control. Then from RadTreeNodeEventArgs you can get the RadTreeNode details.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Nauman
    Nauman avatar
    35 posts
    Registered:
    28 Jul 2008
    25 Feb 2010
    Link to this post
    Thanks Ivan  for your reply, basically i cound not explain well, i want to display the page site map inside the command panel in custom module, the area where from where u can navigate to different views, i know how i can add view, but i need instead of views i need to add page site map. Please see the attached image

    as well when u click any node, u got the event value in backend views, load the respect content inside the main body of the module.


    Thanks

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    25 Feb 2010
    Link to this post
    Hello Nauman,

    What you can do is creating the command panel from user controls, In your Control panel you need to override CreateCommandPanelsFromUserControls and add your user control that has RadTreeView control.  Then when you click on a node you need to pass the item id as a QuerysTring and then open your view. Another option is setting NavigateUrl to any host command.

    Below is a sample code


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.Cms.Web.UI.Backend;
     
    /// <summary>
    /// Summary description for SampleControlPanel
    /// </summary>
    public class SampleControlPanel : ProviderControlPanel<SampleControlPanel>
    {
        public SampleControlPanel()
        {
     
        }
     
        public override string Title
        {
            get
            {
                return "SampleControlPanel";
            }
            set
            {
                base.Title = value;
            }
        }
     
     
     
        protected override void CreateCommandPanelsFromUserControls(string viewMode, List<string> userControls, List<Telerik.Web.ICommandPanel> list)
        {
     
            if (userControls == null)
                userControls = new List<string>();
     
            userControls.Add("~/CustomControls/RadTreeViewCommandPanel.ascx");
            base.CreateCommandPanelsFromUserControls(viewMode, userControls, list);
        }
     
        protected override void CreateCustomCommandPanels(string viewMode, List<Telerik.Web.ICommandPanel> list)
        {
            //base.CreateCustomCommandPanels(viewMode, list);
        }
     
        //third way
        protected override void CreateStandardCommandPanels(string viewMode, List<Telerik.Cms.Web.UI.Backend.CommandItem> commandsInfo, List<Telerik.Web.ICommandPanel> list)
        {
            //base.CreateStandardCommandPanels(viewMode, commandsInfo, list);
        }
      
    }

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="RadTreeViewCommandPanel.ascx.cs" Inherits="CustomControls_RadTreeViewCommandPanel" %>
     
     
    <telerik:RadTreeView runat="server" ID="RTV">
     <Nodes>
       <telerik:RadTreeNode runat="server" Text="node1" Value="node1"></telerik:RadTreeNode>
       <telerik:RadTreeNode runat="server" Text="node2" Value="node2"></telerik:RadTreeNode>
       <telerik:RadTreeNode runat="server" Text="node3" Value="node3"></telerik:RadTreeNode>
       <telerik:RadTreeNode runat="server" Text="node4" Value="node4"></telerik:RadTreeNode>
       <telerik:RadTreeNode runat="server" Text="node5" Value="node5"></telerik:RadTreeNode>
     </Nodes>
     
    </telerik:RadTreeView>

    public partial class CustomControls_RadTreeViewCommandPanel : ViewModeUserControl<SampleControlPanel>, Telerik.Web.ICommandPanel
    {
        protected void Page_Load(object sender, EventArgs e)
        {
             
        }
     
     
         public void Refresh()
        {
            throw new System.NotImplementedException();
        }
      
        /// <summary>
        /// Name for the command panel.
        /// </summary>
        public override string Name
        {
            get
            {
                return "RadTreeViewCommandPanel";
            }
        }
      
        /// <summary>
        /// Title of the command panel.
        /// </summary>
        public override string Title
        {
            get
            {
                return "RadTreeViewCommandPanel";
            }
        }
     
     
        #region ICommandPanel Members
     
     
        public Telerik.Web.IControlPanel ControlPanel
        {
            get { throw new NotImplementedException(); }
        }
     
        #endregion
    }

     

    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Nauman
    Nauman avatar
    35 posts
    Registered:
    28 Jul 2008
    27 Feb 2010
    Link to this post
    Hi Ivan

    Every thing goes perfect, i am nearly to completion of my module, only one thing missing i want to load one of my view with CreateHostViewCommand on sitemap  treeview click event, i tried different ways but i am not successful in doing that

    here is the code

     void tree_NodeClick(object sender, RadTreeNodeEventArgs e)
        {
          //  this.Host.NavigateHostCommand<SiteMapControlPanel>("LoadCustomView", e.Node.Value, null);

    //Response.Redirect(CreateHostViewCommand("LoadCustomView", e.Node.Value, null));

    //e.Node.NavigateUrl = CreateHostViewCommand("LoadCustomView", e.Node.Value, null);

    this.Host.NavigateRootViewCommand("LoadCustomView", e.Node.Value, null);
        }

    pls suggest

    Thanks
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    28 Feb 2010
    Link to this post
    Hello Nauman,

    You cannot use CreateHostViewCommand or NavigateRootViewCommand because the Host is null. The nodes of the RadTreeView control are not actually views. You need to bind the RadTreeView to some source and set the NavigateUrl.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
6 posts, 0 answered