Search code examples
devexpressribbon

how to layout the button item on ribbon pagegroup with the style like the picture


this is the picture the large glyph all on the left . small glyph on the right with vertical allignment. all the button are generated on the code. this is my code using c# for winform showing RibbonPageGroup pagGroup = new RibbonPageGroup(); BarButtonItem barButtonItem = new BarButtonItem(); pagGroup.ItemLinks.Add(barButtonItem);e


Solution

  • You should add your bar item links into PageGroup one by one. For small items use the BarItemLink.BeginGroup property to separate all the next items into button group:

    // ribbonPageGroup1
    ribbonPageGroup.ItemLinks.Add(barButtonItem1);
    ribbonPageGroup.ItemLinks.Add(barButtonItem2);
    ribbonPageGroup.ItemLinks.Add(barButtonItem3, true); // begin group
    ribbonPageGroup.ItemLinks.Add(barButtonItem4);
    ribbonPageGroup.ItemLinks.Add(barButtonItem4);
    

    Use the BarItem.RibbonStyle propety to specify display options for specific bar items:

    barButtonItem3.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonItemStyles.SmallWithText;