RadRibbonForm in RadRibbonForm MDI

6 posts, 0 answers
  1. Roger
    Roger avatar
    16 posts
    Member since:
    Apr 2011

    Posted 24 Aug 2014 Link to this post

    first see the attach file so that you could picture out the things I wanted to do.

    I been using RadRibbon Form as the Parent MDI and RadDocking technology.
    When the user click a button to open another form, the newly opened rad ribbon form will be display directly under the rad dock.

    The newly opened rad ribbon form, I wanted that this ribbon will be displayed in the Parent Ribbon as Contextual Tab and their command tabs.
    And only the panel or what ever controls will remain in the rad dock.


    If ever this is not possible, what controls/forms that can I put in the rad dock? Considering that this controls is a base window.


  2. Dess
    Admin
    Dess avatar
    2110 posts

    Posted 27 Aug 2014 Link to this post

    Hello Roger,

    Thank you for writing.

    Currently, only Menu Merge in MDI applications is supported and it is not supported to handle automatically the MDI child RadRibbonForm creation and create the desired contextual tabs in the parent RadRibbonForm. However, it is a reasonable request. I have logged it in our Feedback Portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - Feedback Item.

    I have also updated your Telerik points.

    You can manually achieve the merging, following the sample approach below:

    public Form1()
    {
        InitializeComponent();
      
        this.AllowAero = false;
        this.IsMdiContainer = true;
        this.radDock1.AutoDetectMdiChildren = true;
    }
      
    private void radButtonElement1_Click(object sender, EventArgs e)
    {
        Form2 childForm = new Form2();
          
        foreach (RibbonTab tab in childForm.RibbonBar.CommandTabs)
        {
            ContextualTabGroup contextualTabGroup = new ContextualTabGroup();
            contextualTabGroup.Text = tab.Title;
          
            this.radRibbonBar1.CommandTabs.Add(tab);
          
            contextualTabGroup.TabItems.Add(tab);
            this.radRibbonBar1.ContextualTabGroups.Add(contextualTabGroup);
            tab.IsSelected = true;
        }
           
        childForm.RibbonBar.Visible = false;
        childForm.Text = "MDI Child " + DateTime.Now.ToShortTimeString();
        childForm.MdiParent = this;
        childForm.Show();
    }

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. k
    k avatar
    3 posts
    Member since:
    Aug 2016

    Posted 10 Jul Link to this post

    It is possible to project
  4. Dess
    Admin
    Dess avatar
    2110 posts

    Posted 11 Jul Link to this post

    Hello , 

    Thank you for writing.  

    I have aattacheda sample project with the code provided in my previous post.

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Valentino
    Valentino avatar
    28 posts
    Member since:
    Aug 2017

    Posted 28 Aug Link to this post

    How should  RadDiagramRibbonBars be handled compared to 'normal' ribbon bars?

    I have tried a modified version of your above code with some success. The Diagram ribbon bar does get merged with the main view's ribbon. But when I add another child form, its diagram ribbon gets added too. Do I need to re-merge this every time I tab to different child views? And similarly, if I undock/restore a child view, do I need to manually remove the diagram bar from the main view, and un-hide it from the child view? Thanks for your time.

    I have this structure. All code is simplified.

    MDI Container

    public partial class MainView : RadRibbonForm

     

    Code to add MDI child

    var view = new ChildView(this)
    {
        Dock = DockStyle.Fill,
        TopLevel = false,
        FormBorderStyle = FormBorderStyle.None,
        MdiParent = this,
        Text = "something",
    };

     

    MDI Child

    public partial class ChildView : RadForm
    {
        public FormView(RadRibbonForm parent)
        {
            InitializeComponent();
     
            radDiagramRibbonBar1.Visible = false;
     
             foreach (var tab in radDiagramRibbonBar1.CommandTabs)
            {
                ContextualTabGroup contextualTabGroup = new ContextualTabGroup {Text = tab.Text};
                parent.RibbonBar.CommandTabs.Add(tab);
     
                contextualTabGroup.TabItems.Add(tab);
                parent.RibbonBar.ContextualTabGroups.Add(contextualTabGroup);
                tab.Select();
            }

     

  6. Valentino
    Valentino avatar
    28 posts
    Member since:
    Aug 2017

    Posted 28 Aug Link to this post

    edit: FormView (constructor) above, should be ChildView
Back to Top