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

Comments

30 posts, 0 answered
  1. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    10 Sep 2007
    Link to this post
    I want to have a "Comments" control that I can place onto pages.  This control would allow users to both view and place comments on pages.

    I know something similar to this has already been built for the "Blogs" module.  Could this same control be applied to a regular page?

    Thanks,

    Gabe
    ==============
  2. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    12 Sep 2007
    Link to this post
    Hello Gabe,

    CommentsList is a public control and it can be used in a regular page too. You need to add the following in <toolboxControls> section in the Web.config to display the control in the "Add Controls" toolbox:

    <add name="CommentsList" section="Comments" type="Telerik.Cms.Engine.WebControls.CommentsList,    Telerik.Cms.Engine" />

    You should create a dummy post as well so you could see the comments in the admin part. In the CommentsList control you should set the ParentID property to the id of that post and for ProviderName set "Blogs" which is the default provider for the blogs.

    Hope this helps.

    Kind regards,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    28 Oct 2008
    Link to this post
    is this still the way to do this, dropping the control onto a page? how do I associate it with a page, do I use "Sitefinity" as the provider (that's the name of my cms provider).

    also, how do you moderate these comments?
  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    29 Oct 2008
    Link to this post
    Hello SelArom,

    Bob has came up with an idea for the implementation of this feature some time ago. This is how it goes:

    Please follow the steps below to test this approach. Note I assume you are using Web Site project. If you are using Web Application project the steps will be slightly different.

    1. Create App_Code folder in the root of your web site
    2. Create PageComments.cs file in the App_Code folder
    3. Paste the following code in PageComments.cs file
      using Telerik;     
      using Telerik.Cms;     
      using Telerik.Cms.Web;     
      using Telerik.Cms.Engine;     
      using Telerik.Cms.Engine.WebControls;     
          
      /// <summary>     
      /// Summary description for PageComments     
      /// </summary>     
      public class PageComments : ContentView     
      {     
          public override string ProviderName     
          {     
              get    
              {     
                  return "Page_Comments";     
              }     
              set    
              {     
                  //This control will work with Page_Comments provider only;     
              }     
          }     
          
          protected override void CreateChildControls()     
          {     
              if (base.Page is CmsPageBase)     
              {     
                  ICmsPage cmsPage = ((CmsPageBase)this.Page).CmsPage;     
                  //Check if we have created content item for this page     
                  IContent cnt = base.Manager.GetContent(cmsPage.ID);     
                  //Create Content Item if not created     
                  if (cnt == null)     
                  {     
                      cnt = base.Manager.CreateContent("text/html", cmsPage.ID);     
                      cnt.SetMetaData("Name", cmsPage.StaticUrl);     
                      cnt.Status = ContentStatus.Published;     
                      base.Manager.SaveContent(cnt);     
                  }     
                  base.SelectedItemId = cmsPage.ID;     
              }     
              //Comments are available only in Detail mode, so our control will work always in Detail mode.     
              base.BehaviorMode = BehaviorModes.Detail;     
              base.AllowComments = true;     
              base.CreateChildControls();     
          }     
      }     
       
    4. Copy all files from ~/Sitefinity/Admin/ControlTemplates/Generic_Content/ folder to a new folder named ~/Sitefinity/Admin/ControlTemplates/Page_Comments/
    5. Copy and replace ~/Sitefintiy/Admin/ControlTemplates/Blogs/App_LocalResources/CommentsList.ascx.resx to ~/Sitefinity/Admin/ControlTemplates/Page_Comments/App_LocalResources/.
      The last step is necessary because of a missing key in the resource file. It will be fixed.
    6. Open web.config file
    7. Add new data provider for Generic Content named Page_Comments and enable comments
      The highlighted attributes are the changed ones!
        <cmsEngine defaultProvider="Generic_Content">     
                  <providers>    
                      <clear/>    
                      <add name="Generic_Content" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="True" defaultMetaField="Name" securityProviderName="" allowLocalization="False" allowVersioning="True" allowWorkflow="False" allowComments="false" commentsModeration="true" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data"/>     
                      <add name="Page_Comments"    
                               applicationName="/Page_Comments"    
                               urlRewriteFormat="[Publication_Date]/[Title].aspx"      
                               urlDateTimeFormat="yy-MM-dd"      
                               urlWhitespaceChar="_" visible="True"      
                               defaultMetaField="Name"      
                               securityProviderName=""      
                               allowLocalization="False"      
                               allowVersioning="True"      
                               allowWorkflow="False"      
                               allowComments="True"      
                               commentsModeration="true"      
                               versioningProviderName=""      
                               connectionStringName="GenericContentConnection"      
                               type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data"    
                               />   
      ...   
       
    8. Add meta fileds for the new provider
      <metaFields>    
                           
                      <add key="Page_Comments.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="Name this content" mandatory="True"/>     
                      <add key="Page_Comments.Description" valueType="LongText" visible="True" searchable="False" sortable="True" defaultValue="Add description here"/>     
                      <add key="Page_Comments.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>     
                      <add key="Page_Comments.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""></add>    
       

    9. Add the new PageComments control to the toolbox

    <cms defaultProvider="Sitefinity" pageExtension=".aspx" disabled="false" pageEditorUIMode="Overlay">     
        ...              
        <toolboxControls>    
           <clear/>    
           <add name="Page Comments" section="Most popular" type="PageComments, App_Code"/>     
        
    ...    
     

    10. Save all files

    11. Drop Page Comments control on a page to test

    When you go to Modules / Generic Content in the admin area, you will notice a combo box on the top left site in the command panel. When you select Page Comments from the combo box you will see Comments link blow. Everything should operate like Blogs.

    Let us know how it goes.


    Kind regards,
    Ivan
    the Telerik team


    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    29 Oct 2008
    Link to this post
    Hi,

    Added using the steps. The sol working in admin side inside GC Module, but adding in the one page the Page_Comments using toolbox I have this issue.  

    Exception Details: System.NotImplementedException: Default template is not yet supported.

    Source Error:

    Line 42:         base.BehaviorMode = BehaviorModes.Detail;
    Line 43:         base.AllowComments = true;
    Line 44:         base.CreateChildControls();
    Line 45:     }
    Line 46: }

    regards
  6. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    29 Oct 2008
    Link to this post
    Hello Pierre,

    yeah, seems I've forgot to add one more thing to do:

    Copy all files from ~/Sitefinity/ControlTemplates/Generic_Content/ folder to a new folder named ~/Sitefinity/ControlTemplates/Page_Comments/

    Hope this helps.

    Greetings,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Matt
    Matt avatar
    22 posts
    Registered:
    25 Jan 2008
    07 Nov 2008
    Link to this post
    This is really helpful, thanks!

    One question, though: if you drop this control onto a single-item news page (with the NewsView control), all the comments are associated with that view page, not the full path to that specific article. Is there a workaround?

    Alternatively, it would be cool if NewsView had an "enable comments on articles" feature.
  8. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    10 Nov 2008
    Link to this post
    Hello Matt,

    NewsView control has a built-in commenting. If you take a look at this template you will notice the commenting controls:
    ~/Sitefinity/ControlTemplates/News/Modes/ListPageDetails.ascx

    While we haven't add the comments setting in the designer (beats me why we haven't done that... I'll investigate), you can turn on the comments from the Advanced tab. Simply edit the NewsView control, switch to Advanced mode, expand the Comments tab and set the AllowComments property to True.

    I hope you'll find this information helpful. Let us know if there is anything else we can do for you.

    Regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Matt
    Matt avatar
    22 posts
    Registered:
    25 Jan 2008
    11 Nov 2008
    Link to this post
    Ok....so where do those comments go for moderation? I don't see any way to get to them via the News or Generic Content modules....
  10. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    13 Nov 2008
    Link to this post
    Hi Matt,

    Please take a look at the attached screenshots - they show where you can see the comments pending for approval.

    http://www.telerik.com/ClientsFiles/106903_NewComments.png
    http://www.telerik.com/ClientsFiles/106902_NewCommentsApprove.png

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  11. Matt
    Matt avatar
    22 posts
    Registered:
    25 Jan 2008
    13 Nov 2008
    Link to this post
    Right...I know where Blog comments go, but when I enable comments on a NewsView control, it says "your comment is awaiting moderation," but there's nowhere to moderate the comment. It doesn't show up under the Blog comments. Do I have to set the ParentID of the NewsView control to a blog?
  12. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    17 Nov 2008
    Link to this post
    Hello Matt,

    You need to enable comments in the News module administration. To achieve this follow the instructions in the following KB: How to enable comments in the News module

    Do let us know if you experience any problems.

    Greetings,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  13. Matt
    Matt avatar
    22 posts
    Registered:
    25 Jan 2008
    11 Mar 2009
    Link to this post
    Both of these solutions (the PageComments control and comments on the NewsView control) have been working great...but then I upgraded to 3.6.

    I'm assuming I need to map a view to an external template for the news module? And the PageComments control shown here now throws a System.Web.HttpUnhandledException error. Any ideas?
  14. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    16 Mar 2009
    Link to this post
    Hi Matt,

    To enable comments in the News module administration, you need to set allowComments attribute for the News data provider to true:

    <cmsEngine defaultProvider="Generic_Content"
          <providers> 
            <clear/> 
            ... 
            <add name="News" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/News" versioningProviderName="" allowComments="true" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.News.Data.DefaultNewsProvider, Telerik.News.Data"/> 
    ... 

    Regarding page comments, follow these instructions:
    1. In PageComments class, override AssemblyInfo and LocalizationAssemblyInfo properties:

    using Telerik; 
    using Telerik.Cms; 
    using Telerik.Cms.Web; 
    using Telerik.Cms.Engine; 
    using Telerik.Cms.Engine.WebControls; 
    using System; 
     
    /// <summary>      
    /// Summary description for PageComments      
    /// </summary>      
    public class PageComments : ContentView 
        public override string ProviderName 
        { 
            get 
            { 
                return "Page_Comments"
            } 
            set 
            { 
                //This control will work with Page_Comments provider only;      
            } 
        } 
     
        public override Type AssemblyInfo 
        { 
            get 
            { 
                return typeof(ContentView); 
            } 
            set 
            { 
                base.AssemblyInfo = value; 
            } 
        } 
     
        public override Type LocalizationAssemblyInfo 
        { 
            get 
            { 
                return typeof(ContentView); 
            } 
            set 
            { 
                base.LocalizationAssemblyInfo = value; 
            } 
        } 
     
        protected override void CreateChildControls() 
        { 
            if (base.Page is CmsPageBase) 
            { 
                ICmsPage cmsPage = ((CmsPageBase)this.Page).CmsPage; 
                //Check if we have created content item for this page      
                IContent cnt = base.Manager.GetContent(cmsPage.ID); 
                //Create Content Item if not created      
                if (cnt == null
                { 
                    cnt = base.Manager.CreateContent("text/html", cmsPage.ID); 
                    cnt.SetMetaData("Name", cmsPage.StaticUrl); 
                    cnt.Status = ContentStatus.Published; 
                    base.Manager.SaveContent(cnt); 
                } 
                base.SelectedItemId = cmsPage.ID; 
            } 
            //Comments are available only in Detail mode, so our control will work always in Detail mode.      
            base.BehaviorMode = BehaviorModes.Detail; 
            base.AllowComments = true
            base.CreateChildControls(); 
        } 

    2. Create a new folder under ~/Sitefinity/ControlTemplates/ and name it Page_Comments. Then, copy all files from ~/Sitefinity/ControlTemplates/Generic_Content/ to the new folder.
    3. Open the project web.config file and make the necessary changes (for details see Ivan's explanation).

    Let us know how it goes.

    Greetings,
    Pepi
    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.
  15. Kevin
    Kevin avatar
    42 posts
    Registered:
    15 Mar 2005
    29 Jun 2009
    Link to this post
    I've been able to get this working on 3.6, and when I go in the admin panel under 'Modules/Generic Content/Page_Comments' I can see that entries are being created.  However, I have two problems with this solution:

    1.) When I click the submit comment button, absolutely nothing happens
    2.) I don't see how to customize the appearance of the control, and at the moment at the top of every comment section I have "~/Articles/MyArticeUrl.aspx" in large header text, which corresponds to the name of the article that was created.  Where can I go to customize the appearance of this in 3.6?

    In any case, this would be a great feature to add natively in 4.0 since it seems many people are looking for the same functionality.
  16. Kevin
    Kevin avatar
    42 posts
    Registered:
    15 Mar 2005
    03 Jul 2009
    Link to this post
    I have everything working with this now.  Thanks a lot for the initial code, etc.  As for customizing the appearance, though, I'm still not really sure which 'external template' I should be using to change the appearance to match the rest of my site.  I tried using 'Sitefinity/ControlTemplates/Blogs/CommentsList.ascx', but they apparently aren't the same (I'm using version 3.6 SP2 for reference sake).

    Is there any chance you would be able to provide an external template for this control or let us know exactly which external template it is based on?

    Kevin.
  17. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Jul 2009
    Link to this post
    Hi Kevin,

    The control currently uses the embedded templates - ContentViewItemList and ContentViewSingltem.

    If you want to change the appearance of the control you should map these templates from the external archive that we provide for downloading under MyClient >> downloads section. The templates can be mapped from Appearance category of the custom control properties. The control uses only details mode so you can map ContentViewSingltem.ascx file.

    Inside ContentViewSingle item there is a control CommentsList

    <div id="comments" class="sf_contentComments"
        <sfWeb:CommentsList ID="commentsList" LayoutTemplatePath="PATH TO YOUR TEMPLATE" runat="server" CssClass="sf_commentsList"></sfWeb:CommentsList> 
    </div> 

    Declare layoutTemplatePath for this control to CommentsList template. The template is located under
    [1936_ExternalTemplates]/Sitefinity/ControlTemplates/Generic_Content/CommentsList.ascx

    Best wishes,
    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.
  18. Kevin
    Kevin avatar
    42 posts
    Registered:
    15 Mar 2005
    03 Jul 2009
    Link to this post
    Ivan:

    That works perfectly.  Thanks.  I'm going to have to buy the standard version, not really because I need the workflow or globalization features, but simply to say thanks for the amazing support you guys offer (whether with Sitefinity itself or Telerik's other control suites).  It's consistently the best support I've seen from a software company!

    Kevin.
  19. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Jul 2009
    Link to this post
    Hello Kevin,

    Always glad to help to the community.

    Greetings,
    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.
  20. Kevin
    Kevin avatar
    42 posts
    Registered:
    15 Mar 2005
    06 Jul 2009
    Link to this post
    I've been busy integrating this into all my pages (thanks again for the help with that), but was wondering if there is a way to add this 'control' to a master page rather than manually having to manage it for each and every page?  I'm doing to same thing for the login controls, etc., just putting them in a master page with the following declaration:

    <%

    @ Register Src="~/Sitefinity/UserControls/Login/LoginViewControl.ascx" TagName="LoginView" TagPrefix="sitefinity" %>

     


    Given that Page_Comments isn't actually a user control, though, and that it sits in App_Code, I'm not sure if it's still possible to reference it this way to add it to the .master page?  The real issue is that it's a pain to have to constantly change the SingleItemTemplatePath property to ~/Custom/ControlTemplates/Page_Comments/ContentViewSingleItem.ascx to keep the look and feel consistent with my site.  More importantly, it will be a nightmare if I ever want to use a different external template! 

    If anyone can suggest a way to do this once in a master page, I'd certainly appreciate it.



  21. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Jul 2009
    Link to this post
    Hi Kevin,

    To add the custom control to your master page you can declare it as below:

     <%@ Register  TagPrefix="pc" Assembly="App_Code" %>   
     
         .... 
             .... 
     
    <pc:PageComments ID="pc1" runat="server"></pc:PageComments> 

    You can also add namespace attribute, so that you will call only user controls from specified namespace. You can also drop the Page comments control on your masterpage through Sitefinity UI. this will allow you to manage the properties in design mode. Therefore you will be able to set the SingleItemTemplatePath only on one place.

    I hope this helps.

    Sincerely yours,
    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.
  22. Kevin
    Kevin avatar
    42 posts
    Registered:
    15 Mar 2005
    23 Jul 2009
    Link to this post
    I have this working quite well for me now, with the 'comments' form added in the master page itself as follows:

              <%-- Start Main Content --%>    
              <div id="left">  
                <asp:contentplaceholder id="Content" runat="server"></asp:contentplaceholder> 
                <pc:PageComments ID="pageComments" runat="server" SingleItemTemplatePath="~/Custom/ControlTemplates/Page_Comments/ContentViewSingleItem.ascx"></pc:PageComments>   
              </div>            
     

    I've noticed, though, that every time I try to edit a template in the back-end (rather than a 'page', which works fine), I'm getting in exception in the following method trying to access cmsPage.ID:

        protected override void CreateChildControls()  
        {  
          if (base.Page is CmsPageBase)  
          {  
            ICmsPage cmsPage = ((CmsPageBase)this.Page).CmsPage;  
            //Check if we have created content item for this page         
            IContent cnt = base.Manager.GetContent(cmsPage.ID);  
            //Create Content Item if not created         
            if (cnt == null)  
            {  
              cnt = base.Manager.CreateContent("text/html", cmsPage.ID);  
              cnt.SetMetaData("Name", cmsPage.StaticUrl);  
              cnt.Status = ContentStatus.Published;  
              base.Manager.SaveContent(cnt);  
            }  
            base.SelectedItemId = cmsPage.ID;  
          }  
          //Comments are available only in Detail mode, so our control will work always in Detail mode.         
          base.BehaviorMode = BehaviorModes.Detail;  
          base.AllowComments = true;  
          base.CreateChildControls();  
        }  
     
    Is there a straight forward way that I would check if a page was a template or if I'm editing a template and perhaps disabled the PageComments control, for example?

    Kevin.



  23. Kevin
    Kevin avatar
    42 posts
    Registered:
    15 Mar 2005
    23 Jul 2009
    Link to this post
    As a sidenote, for the moment I'm just checking if cmsPage == null (and doing nothing if that's the case since it probably means I'm editing a template).  That seems to work OK as a quick fix.
  24. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Jul 2009
    Link to this post
    Hello Kevin,

    Please modify the method as below:

        protected override void CreateChildControls() 
        { 
            if (base.Page is CmsPageBase) 
            { 
                ICmsPage cmsPage = ((CmsPageBase)this.Page).CmsPage; 
                if (cmsPage != null
                { 
                    //Check if we have created content item for this page       
                    IContent cnt = base.Manager.GetContent(cmsPage.ID); 
                    //Create Content Item if not created       
                    if (cnt == null
                    { 
                        cnt = base.Manager.CreateContent("text/html", cmsPage.ID); 
                        cnt.SetMetaData("Name", cmsPage.StaticUrl); 
                        cnt.Status = ContentStatus.Published; 
                        base.Manager.SaveContent(cnt); 
                    } 
                } 
                if (cmsPage != nullbase.SelectedItemId = cmsPage.ID; 
            } 
            //Comments are available only in Detail mode, so our control will work always in Detail mode.       
            base.BehaviorMode = BehaviorModes.Detail; 
            base.AllowComments = true
            base.CreateChildControls(); 
        } 


    Best wishes,
    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.
  25. Vishal Sharma
    Vishal Sharma avatar
    10 posts
    Registered:
    20 May 2010
    10 Feb 2011
    Link to this post
    Hi,
    I had enabled comment feature on my website. I am looking for advanced comment feature, where I can notify the readers who had commented on any of my blog post, when some one else post a new comment on Same blog post. basically notification to all reader should go (opt in check box), if a new comment is posted on same blog post.
    How can i enable that feature in sitefinity?

    Regards
    Vishal
  26. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Feb 2011
    Link to this post
    Hello Matt,

    You should create a custom class that inherits from BlogCommentsList and there you have to override InitializeControls and subscribe for SubmitButton.Command and there you can send your email message.

    You could take a look at this post

    All the best,
    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
  27. Qainan
    Qainan avatar
    24 posts
    Registered:
    25 Oct 2011
    31 Oct 2011
    Link to this post
    Hi,

    Can I use system in version 4, is there any alternative to do this ?

    Regards,
    QainanIdris.com
  28. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Oct 2011
    Link to this post
    Hello Qainan,

    You can override detail list view of the content view based control and replace it through configurations. Another option is overriding the data provider of the module you want to change and there change the logic for creating comments.

    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
  29. Qainan
    Qainan avatar
    24 posts
    Registered:
    25 Oct 2011
    01 Nov 2011
    Link to this post
    Hi Ivan,

    Thank you for your reply. Please can you provide me sample code.

    Regards,
    qainanidris.com
  30. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 Nov 2011
    Link to this post
    Hi Qainan,

    Here is a sample code

    public class Class1 : Telerik.Sitefinity.Modules.Events.Web.UI.Public.DetailsView
    {
     
        protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container, Telerik.Sitefinity.Web.UI.ContentUI.Contracts.IContentViewDefinition definition)
        {
            //base.InitializeControls(container, definition);
            this.SingleItemContainer.ItemDataBound += new EventHandler<RadListViewItemEventArgs>(SingleItemContainer_ItemDataBound);
        }
     
        private void SingleItemContainer_ItemDataBound(object sender, RadListViewItemEventArgs e)
        {
            if (e.Item.ItemType == RadListViewItemType.DataItem || e.Item.ItemType == RadListViewItemType.AlternatingItem)
            {
                var view = e.Item.FindControl("commentsDetailsView") as ContentView;
     
            }
     
            if (SystemManager.IsBrowseAndEditMode)
            {
                BrowseAndEditManager.GetCurrent(this.Page).AddBrowseAndEditToolBar(e.Item, this.Host, this.browseAndEditToolbarId);
            }
     
        }
     
        private



    Greetings,
    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
Register for webinar
30 posts, 0 answered