Add radribbontab, radribbongroup, radorderedwrap panel in code behind

5 posts, 0 answers
  1. Ken
    Ken avatar
    2 posts
    Member since:
    Dec 2010

    Posted 12 Mar 2012 Link to this post

    I have a page based wpf application, where a user enters information and clicks on a "Next" button, and is brought to a new page, passing the information along.  When the second page is reached, I want to dynamically add tab(s), group(s), and wrappanel(s), based on how many inputs they submitted.  I am trying the following, but it is exceptioning out with the following error:

    Layout measurement override of element 'Telerik.Windows.Controls.RibbonView.Primitives.RibbonGroupsPanel' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size.

                 RadOrderedWrapPanel checkpointwrap = new RadOrderedWrapPanel();
                checkpointwrap.Name = "ckwrap";

                RadRibbonGroup checkpointgroup = new RadRibbonGroup();
                checkpointgroup.Name = "ckp_" + "2";
                checkpointgroup.Header = "GroupTest";

                RadRibbonTab checkpointtab = new RadRibbonTab();
                checkpointtab.Name = "CKP1";

  2. Ken
    Ken avatar
    2 posts
    Member since:
    Dec 2010

    Posted 12 Mar 2012 Link to this post

    Found the issue.  Instead of adding to my Grid, I just needed to add the tab to the ribbonview:


    Tabs/Groups/Wrappanels are now built dynamically
  3. DevCraft R3 2016 release webinar banner
  4. Miro Miroslavov
    Miro Miroslavov avatar
    588 posts

    Posted 14 Mar 2012 Link to this post

    Hello Ken,

     Yes, you need to add the Tabs to the Ribbon. Please let us know if you have other issues. 

    All the best,
    Miro Miroslavov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  5. Marcello
    Marcello avatar
    57 posts
    Member since:
    Apr 2013

    Posted 02 Aug 2013 Link to this post


    with last version of controls (2013 Q2) RadRibbonView don't contain a Children properties.
    How to add dinamically, in codebihind, a new tab to a RadRibbonView?

  6. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1165 posts

    Posted 07 Aug 2013 Link to this post

    Hi Marcello,

    You are right that there is no Children collection exposed by the RadRibbonView control in our latest official release. However, in order to add/remove RadRibbonTabItems at runtime you can use a HierarchicalDataTemplates. The required structure of the hierarchy is the following:
    RadRibbonView -> RadRibbonTab -> RadRibbonGroup -> other RadRibbon controls. Hence, you need to implement hierarchy matching this structure. You can take a look at this demo to see how we implemented this structure.

    I hope this information will help you. Don't hesitate to ask if you have any other questions.

    Pavel R. Pavlov
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft R3 2016 release webinar banner