More in this section

Forums / General Discussions / custom blog design or template

custom blog design or template

2 posts, 0 answered
  1. Jmr
    Jmr avatar
    53 posts
    Registered:
    21 Jan 2011
    08 Feb 2011
    Link to this post
    Hello

    I want to create a custom blog post control which it should display only one particular blog (using API) and below i should able to add comments with out going another page 

    please send me the sample template.

    thanks
    jmr
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Feb 2011
    Link to this post
    Hello Jmr,

    In your template you can declare

    <sf:ContentView
                 id="commentsDetailsView"
                 ControlDefinitionName="EventsCommentsFrontend"
                 DetailViewName="CommentsDetailsView"
                 ContentViewDisplayMode="Detail"
                 runat="server" />


    Then in the code behind you have to bind the control you have and the content item comments

    /// <summary>
         /// Handles the ItemDataBound event of the DetailsView control.
         /// </summary>
         /// <param name="sender">The source of the event.</param>
         /// <param name="e">The <see cref="Telerik.Web.UI.RadListViewItemEventArgs"/> instance containing the event data.</param>
         private void DetailsView_ItemDataBound(object sender, RadListViewItemEventArgs e)
         {
             if (e.Item.ItemType == RadListViewItemType.DataItem || e.Item.ItemType == RadListViewItemType.AlternatingItem)
             {
                 var view = e.Item.FindControl("commentsDetailsView") as ContentView;
                 this.InitCommentsView(view);
             }
     
             if (this.IsInBrowseAndEditMode())
             {
                 BrowseAndEditManager.GetCurrent(this.Page).AddBrowseAndEditToolBar(e.Item, this.Host, this.browseAndEditToolbarId);
             }
         }
     
         /// <summary>
         /// Handles the ItemCreated event of the DetailsView control.
         /// </summary>
         /// <param name="sender">The source of the event.</param>
         /// <param name="e">The <see cref="Telerik.Web.UI.RadListViewItemEventArgs"/> instance containing the event data.</param>
         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);
             }
         }


    Best wishes,
    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
2 posts, 0 answered