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

Forums / Developing with Sitefinity / SiteMapDataSource

SiteMapDataSource

8 posts, 1 answered
  1. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    14 Aug 2009
    Link to this post

    In the SiteMenu there is an option to select the starting node.
    In the SitePanel, that does not apear to be the case.
    I need this functionality, so i chose to try to use the SiteMapDataSource with teh SitePanel.

    Having put the SiteMapDataSource on my Template, I then chose the start node.
    Looks like it might work.

    I then dragged a SitePanel onto the Template and selected Edit, Misc, Penelbar Edit, then in Data, DataSourceID i put in the ID from my SiteMapDataSource (tm_SiteMapDataSource1).

    Trying to save it and i get an error:

    The DataSourceID of 'RadPanelbar1' must be the ID of a control of type IDataSource.  A control with ID 'tm_SiteMapDataSource1' could not be found.

    :(
    It looked like such a good idea, does anyone know what i am doing wrong?

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    14 Aug 2009
    Link to this post
    Hi Andrew,

    Thank you for using our services.

    You are getting this behavior, because you the SiteMapDataSource control needs to be initialized before the SitePanleBar control. If your Panel Bar control is put before the SiteMapDataSource it will get initialized before the SiteMapDataSource and will not be able to find the control. Can you open your template for editing, and in the ContentPlaceHolder where you have the controls just drag the SitePanelBar to be bellow the SiteMapDataSource control. So when the page is rendered SiteMapDataSource will get initialized first

    This should do the trick. If you have more questions, please feel free to contact us.

    Greetings,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    14 Aug 2009
    Link to this post
    I tried that. But it does not work.
    I still get the same error.
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    14 Aug 2009
    Link to this post
    Hi Andrew,

    Thank you for getting back to me.

    Can you try the same, but instead using the Site Panel Bar control from the Navigation section, using the RadPanelBar control from the RadControls section in the toolbox.

    In the mean time I will try to see why this is happening with the Site Panel Bar control.

    Kind regards,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  5. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    14 Aug 2009
    Link to this post
    Yes, you are right. It works with the RadPanelBar.

    Strange that it does not with SitePanelBar.

    Thanks.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    14 Aug 2009
    Link to this post
    Hello Andrew,

    SitePanelBar is declaratively bound to CmsSiteMapDataSource control. Also the control has the same functionality as RadPanelBar control. When you use RadPanelBar control the data source you use should be added in the same naming container, otherwise the datasource cannot be found.
    ShowStartingNode is a bool property of SiteMapDataSource control and it can be additionally implemented.

       public bool ShowStartingNode 
        { 
            get 
            { 
                return this.SiteMapDataSource1.ShowStartingNode; 
            } 
            set 
            { 
                this.SiteMapDataSource1.ShowStartingNode = value; 
            } 
        } 

    Let us know if you need further assistance.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    Answered
  7. Andrew
    Andrew avatar
    202 posts
    Registered:
    05 Jun 2009
    15 Aug 2009
    Link to this post
    Thanks Ivan,

    That sounds like a good idea.

    Here is what i did for anyone interested.

    I added this code

    using Telerik.Cms.Web.UI;  
     
    [WebEditor("Telerik.Cms.Web.UI.UrlEditorWrapper, Telerik.Cms")]  
     
    [Browsable(true)]  
     
    [Category("Navigation")]  
     
    public string StartingNodeUrl  
     
    {  
     
    get 
     
    {  
     
    return this.SiteMapDataSource1.StartingNodeUrl;  
     
    }  
     
    set 
     
    {  
     
    this.SiteMapDataSource1.StartingNodeUrl = value;  
     
    }  
     
    }  
     
     

    to my : "sitefinity/UserControls/Navigation35/SitePanelBar.ascx.cs"

    To expose the functionality for choosing the start item in the SitePanelBar control.
    This way i don't need to put in the extra data source.

    Andrew
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    15 Aug 2009
    Link to this post
    Hi Andrew,

    I am glad to hear that everything is working as expected.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
8 posts, 1 answered