Content Lists

Posted by Community Admin on 04-Aug-2018 14:21

Content Lists

All Replies

Posted by Community Admin on 17-Jun-2011 00:00

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

Posted by Community Admin on 20-Jun-2011 00:00

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
DynamicMarkupGenerator
Name
Name
ResourceClassId
ResourceClassId
HeaderCssClass
HeaderCssClass
HeaderText
HeaderText
TitleText
TitleText
ItemCssClass
ItemCssClass
Width
Width
DisableSorting
A flag for disabling sorting at data column.
Disable Sorting
SortExpression
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

This thread is closed