Bug Report B182002
Visible to All Users

Templates - Duplicate Actions in Ribbon UI under certain circumstances

created 14 years ago

See the attached project. On the Article page, actions are duplicated.

Comments (1)
Dennis Garavsky (DevExpress) 14 years ago

    Hello Julien,
    We have fixed this problem in version 10.2.5. For now, please use the following workaround:

    C#
    ... static void winApplication_CreateCustomTemplate(object sender, CreateCustomTemplateEventArgs e) { if(e.Context == TemplateContext.ApplicationWindow) { MainForm mainForm = new MainForm(); mainForm.RibbonTransformer.BarItemAdding += new EventHandler<DevExpress.ExpressApp.Win.Templates.ActionContainers.BarItemAddingEventArgs>(RibbonTransformer_BarItemAdding); mainForm.RibbonTransformer.Transformed += new EventHandler<EventArgs>(RibbonTransformer_Transformed); e.Template = mainForm; } } static void RibbonTransformer_Transformed(object sender, EventArgs e) { ClassicToRibbonTransformer transformer = (ClassicToRibbonTransformer)sender; transformer.BarItemAdding -= new EventHandler<DevExpress.ExpressApp.Win.Templates.ActionContainers.BarItemAddingEventArgs>(RibbonTransformer_BarItemAdding); transformer.Transformed -= new EventHandler<EventArgs>(RibbonTransformer_Transformed); } static void RibbonTransformer_BarItemAdding(object sender, DevExpress.ExpressApp.Win.Templates.ActionContainers.BarItemAddingEventArgs e) { ClassicToRibbonTransformer transformer = (ClassicToRibbonTransformer)sender; if(e.Group != null && transformer.FindBarItemLinkByCaption(e.Group.ItemLinks, e.Item.Caption) != null) { e.Group = null; } } ...

    You can subscribe to the CreateCustomTemplate event of the winApplication object either within the Program.cs file or in the construction or your WinApplication class descendant.
    Please let us know if we can help you further.
    Thanks,
    Dennis

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.