More in this section

Content Lists

2 posts, 1 answered
  1. Nicolas
    Nicolas avatar
    156 posts
    Registered:
    19 Jan 2011
    17 Jun 2011
    Link to this post
    Hi,

    I have questions on Lists type and their items.
     1- lists titles will become multilanguages ? It can be comfortable for backend users.
     2- Is it possible to have comments on list items as for news?


    Regards,
    Nicolas
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jun 2011
    Link to this post
    Hello Nicolas,

    You can enable localization for the parent object - List from the configurations.
    Go to
    Lists
    • Controls
      • ListsBackend
        • Views
          • ListsBackendList
            • Decision screens
            • Dialogs
            • Prompt Dialogs
            • View Modes
              • Grid
                • Columns

    and here you need to create a new column DynamicColumnElement with the following content

    Translations

    Defines the collection of columns to be used by the view.

         
    DynamicMarkupGenerator
    Name
    ResourceClassId
    HeaderCssClass
    HeaderText
    TitleText
    ItemCssClass
    Width
    A flag for disabling sorting at data column.
    Disable Sorting
    The sort expression for the particular column in the grid



    There is localization for the child item already enabled.


    Adding comments - this requires a new view. You need a custom control that inherits from ListView and overriding LoadView(string viewName) you can register a custom view for your control.
    Inside the item created you need to init the comments view


    sample

    private void DetailsView_ItemCreated(object sender, RadListViewItemEventArgs e)
            {
                if (e.Item.ItemType == RadListViewItemType.DataItem || e.Item.ItemType == RadListViewItemType.AlternatingItem)
                {
                    var view = e.Item.FindControl("commentsListView") as ContentView;
                    this.InitCommentsView(view);
                }
            }

            #endregion

            #region Helper methods

            private void InitCommentsView(ContentView view)
            {
                if (view != null)
                {
                    view.ControlDefinition.ProviderName = this.Host.ControlDefinition.ProviderName;
                    var detailItem = this.Host.DetailItem as Content;
                    if (detailItem != null)
                    {
                        view.DetailItem = detailItem;
                    }
                }
            }

    where in the template you have

    <sf:ContentView
                 id="commentsListView"
                 ControlDefinitionName="MyListsCommentsFrontend"
                 DetailViewName="CommentsMasterView"
                 ContentViewDisplayMode="Master"
                 runat="server" />
            <sf:ContentView
                 id="commentsDetailsView"
                 ControlDefinitionName="MyListsCommentsFrontend"
                 DetailViewName="CommentsDetailsView"
                 ContentViewDisplayMode="Detail"
                 runat="server" />



    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
2 posts, 1 answered