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

Forums / Developing with Sitefinity / Add automatic CommandPanel in Views

Add automatic CommandPanel in Views

6 posts, 0 answered
  1. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    27 Apr 2009
    Link to this post
    Hi,

    I'm litle confusing about adding commandPanels in Views. I have created one View1 that inherit from Main CommandPanel. The View is working and one item is added to MainCommandPanel to navigate to. After that I have created one new view2 like View2:ViewModeControl<View1> and added the ItemsView but no automatic command panel is generated. I searching something like
    ViewLevel1-->ViewLevel2-->ViewLevel3 and child items. Adding child Items and ViewLevel1 is working for me but adding the ViewLevel2, ViewLevel3 command panels not.

    Sample.
    VentasGestionView is ViewLevel1 that inherit from Main CommandPanel
    VentasPlanningView is ViewLevel2
     
        public class VentasPlanningView : ViewModeControl<VentasGestionView>, IGenericContentHost  
        {  
            public VentasPlanningView()  
            {  
            }  
     
             public VentasPlanningView(bool autoGenerateViewCommands)  
                : base(autoGenerateViewCommands)  
            {  NOT ACCEPTED ERROR !
            }  
            /// <summary> 
            /// Loads configured views.  
            /// </summary> 
            protected override void CreateViews()  
            {  
                base.AddView<VentasPlanningItem>(null, "vPlanning", "vPlanningText", string.Empty, Messages.ResourceManager);  
            } 

     Adding ItemsView is clear but command panels i need some complementary help. I have read all items from Blog dev! but something is not clear to me.

    Thanks.       
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    27 Apr 2009
    Link to this post
    Hello Pierre,

    Here is a sample of implementing Automatically Generated Commands

    using System;  
    using System.Collections.Generic;  
    using System.Linq;  
    using System.Web;  
    using Telerik.Cms.Web.UI.Backend;  
     
    /// <summary>  
    /// Summary description for CustomControlPanel  
    /// </summary>  
    public class CustomControlPanel : ProviderControlPanel<CustomControlPanel>  
    {
        #region Cinstructors  
     
        /// <summary>  
        /// Use automatic command generation  
        /// </summary>  
        public CustomControlPanel() : base(true)  
        {  
        }
        # endregion Constructors  
     
        #region Control Panel Methods  
     
        /// <summary>  
        /// add views. Our views should inherit from ViewModeControl<CustomControlPanel>  
          
        /// </summary>  
        protected override void CreateViews()  
        {  
            AddView<CustomView>("CustomView""MyCustomView""here is my decription""all"null);  
            AddView<CustomView2>("CustomView2""MyCustomView""here is my description", all, null);  
        }
        #endregion Control Panel Methods  
     
     


    All the best,
    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.
  3. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    27 Apr 2009
    Link to this post
    Hi Ivan,
    Thanks but I can't generate the commandPanel for level2. The Commnad Panel for Level1 is ok, my problem are the command panels for next sub levels.

    Level1 : ok
    CustomControlPanel : ProviderControlPanel<CustomControlPanel>
    Add.CustomView....is working.. now add command panel for CustomView

    Level2 :CommandPanel for CustomView child of CustomControlPanel
    - CustomView:ProviderControlPanel<CustomView> Error not the way
    - CustomView:ViewModeControl<CustomControlPanel> Accepted but not generating Commands for child items inside.
    - CustomView:ProviderControlPanel<CustomControlPanel> Error ViewMode is not generated for this control? but you can see Add.CustomView in first CustomControlPanel.
    I don't understand where is the problem.

    Regards
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    28 Apr 2009
    Link to this post
    Hello Pierre,

    Could you sent the whole code you have?

    Regards,
    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.
  5. Nigel
    Nigel avatar
    49 posts
    Registered:
    07 Jul 2008
    14 Jun 2009
    Link to this post
    What was the outcome on this. I too am having problems understanding how to create sub views, and update the command pannel when changing view.
  6. Pierre
    Pierre avatar
    433 posts
    Registered:
    16 Feb 2006
    14 Jun 2009
    Link to this post

    Hi Nigel,
    This is the last response  : As I see it you want to have sub view of an view. This is not supported. The way you can get sub views working requires implementation of views that do not inherits from ViewModeControl, but for the root views you have created. 
    May be Ivan could help us with one sample? Regards

     

Register for webinar
6 posts, 0 answered