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

Forums / Deployment / RAD Controls Reference

RAD Controls Reference

8 posts, 0 answered
  1. Paul Kavanagh
    Paul Kavanagh avatar
    13 posts
    Registered:
    05 Oct 2005
    22 Nov 2006
    Link to this post
    Wondering if you have any documentation available (if it is around I have not seen it) on the implementation specific api's available for the controls. For instance, I made a copy of the radmenucontrol.ascx file, and want to change some of the attributes,
    <radM:RadMenu
        ID="menu1" Runat="server" 
       />

    For the DNN project, you have published a list of api's, of which some are specific to the implementation. For instance, in this case I am interested in setting the start point for the nav to the top parent item (a section nav). In the dnn project that is set with the ShowOnlyCurrent propert set to ChildItems.

    Is there something analogous to this for the menu control in Sitefinity, and in general is there documentation on these implementation specific properties for the various RAD controls integrated with Sitefinity?

    Thanks,

    Paul
  2. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    23 Nov 2006
    Link to this post
    Hi Paul,

    You can find the r.a.d.controls documentations here:
    http://www.telerik.com/support/documentation/telerik-help-center.aspx.

    Sitefinity uses the standard r.a.d.controls and all cms specific logic is implemented in the User Controls in ~/Controls/RadControls folder (e.g. RadMenuControl.ascx, RadTreeviewControl.ascx, etc. ), which are actually wrappers of the r.a.d.controls. 

    For example: by default the menu is populated with the Page structure of the site in the RadMenuControl.ascx codebehind:

    DesignerPageCollection pages;
    if ((DesignerMode == DesignerModes.Public) ||
        (DesignerMode == DesignerModes.PublicLogged))
    {
        pages = TelerikCmsContext.Current.CmsManager.GetPublishedPages(PageLanguage);
    }
    else
    {
        pages = TelerikCmsContext.Current.CmsManager.GetPages(PageLanguage);
    }
    BuildMenu(pages);
    // Populates r.a.d.menu with the pages collection

    The best examples for the specific Sitefinity implementation of the r.a.d.controls are exaclty the User Controls controls in the ~/Controls/RadControls folder. Also you can take a look at Integrated Controls topic in the Administration Manual.


    Hope this will help. Please, let us know if you need to implement something specific and we will gladly help you further.



    Kind regards,
    Vlad
    the telerik team
  3. Paul Kavanagh
    Paul Kavanagh avatar
    13 posts
    Registered:
    05 Oct 2005
    23 Nov 2006
    Link to this post
    Thanks! Okay, so any implementation logic that already exists can be found in the controls. So, I want to add the logic similar to the DNN Skinobject properties to specify a starting point fo rthe menu. Assuming that we start with the dataset returned from GetPages(PageLanguage); method, any pointers on logic to trim the data set to only show the pages from the highest root parent above the current page (in effect creating a section specific nav).

    Thanks!

    Paul
  4. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    23 Nov 2006
    Link to this post

    Hello Paul,

    The GetPages(PageLanguage) method returns an object that represents hierarchical structure of the pages.
    See the BuildMenu(DesignerPageCollection pages) method in the RadMenuControl.ascx:

    private void BuildMenu(DesignerPageCollection pages)
    {
        foreach (IDesignerPage page in pages.RootPage.Pages)
        {
            if (!page.IsNavigable)
            {
                continue;
            }
            Telerik.WebControls.RadMenuItem item = new Telerik.WebControls.RadMenuItem();
            menu1.Items.Add(item);

            if (page.Id == this._pageId)
            {
                item.CssClass = this.selectedItemCssClass;
            }

            if (page.Details.Alias == string.Empty)
            {
                item.Text = page.Details.Name;
            }
            else
            {
                item.Text = page.Details.Alias;
            }
            item.NavigateUrl = Helper.GetPageUrl(page.Details.Name, page.Guid);
            LoadMenuItemsRecursive(page, item, page.Details.Name);
        }
    }

    Calling pages.RootPage.Pages will return only the root level pages and Pages property of each instance IDesignerPage object will return only its child pages.

    Also have a look at the implementation of RadPanelbarControl.ascx. It has two properties: RootLevel and NestingLevels. Set the RootLevel property to the index of the root level pages to display, the defauld is 0 that means the highest level. Set NestingLevels property to the number of nesting levels to expand the panelbar, the default is 1. The same logic could be implemented with the menu as well.

    Please let us know if you need more help.

    Greetings,

    Vlad
    the telerik team
  5. Paul Kavanagh
    Paul Kavanagh avatar
    13 posts
    Registered:
    05 Oct 2005
    29 Nov 2006
    Link to this post
    Thanks! For the pages.RootPage object, is there a property or method to set on the pages object what we want as the Root. Something like instead of pages.RootPage.pages, pages.(getPageByID(122)).pages.

    Or, pages.RootPage = GetPageByID(122), then For --Each.

    That would be much simpler that iterating through the collection to build the nav. I have not been able to get the above to work.

    Thanks,

    Paul 
  6. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    30 Nov 2006
    Link to this post
    Hi Paul,

    You cannot set the pages.RootPage property. The object returned from GetPages(PageLanguage) method only presents the pages structure, it cannot be modified.
    Instead you can get a specific page by id and iterate though its children:

    //gets the page with pageId = 122 and builds the navigation with its children;
    IDesignerPage page = pages.GetPageById(122);
    foreach (IDesignerPage childPage in page.Pages)
    {
     // iterate through the child pages collection to build the navigation control
    }

    Does this help or have I missed something?

    Regards,
    Vlad
    the telerik team
  7. mukesh
    mukesh avatar
    25 posts
    Registered:
    21 Aug 2010
    25 Aug 2010
    Link to this post
    Hi
     i have use form builder in sitefinity cms, i need to use list box control but form builder doesn't have list box control.
    how to use list box in our form. 
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    25 Aug 2010
    Link to this post
    Hi mukesh,

    Here is a link to the RadListBox documentation that explains how to use the control. Form builder is not a built-in module you could contact the owner to update the code or if you have the source you can make the modifications.

    Kind 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
8 posts, 0 answered