Hi DevExpress,
I'm creatin the XAF version of an existing application.
I had a ribbon in the old version and I would like to get approximatively the same ribbon in my XAF application.
Attached, you'll find a picture of what does the old application looks like.
I think that I could create this ribbon programmatically, using controllers. But is there a more friendly way, with some kind of designer, or, at least in the model designer, to create such a ribbon ?
Many thanks in advance,
Julien
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.
Hi Julien,
The Ribbon UI is generated from bars, defined in a window template. You can affect this process using the following approaches:
public event EventHandler<ResolveBarItemTargetPageEventArgs> ResolveBarItemTargetPage;
public event EventHandler<ResolveMainMenuItemTargetPageEventArgs> ResolveMainMenuItemTargetPage;
public event EventHandler<CustomTransformBarLinkContainerEventArgs> CustomTransformBarLinkContainer;
public event EventHandler<BarItemAddingEventArgs> BarItemAdding;
public event EventHandler<BarItemAddedEventArgs> BarItemAdded;
You can also extend the application model with additional properties, and check them in the above event handlers. Then, you will be able to customize the Ribbon UI generation using Model Editor. However, this requires additional code to be written.
Thanks,
Michael.
Hi Michael,
I can't figure how to add a new action container to my template.
I've read that I have to do it at runtime, but didn't find any sample on how to do it.
Can you please point me to a simple sample that creates a new action container and then add an action to it ?
The next step will be to use large or small buttons to display my actions. As you can see in the picture I posted in my first post, some action should use large buttons and some should use small buttons in the ribbon.
Of course, the action container should also be displayed when the form doesn't use a ribbon.
Many thanks,
Julien
Hi Julien,
From version 10.2 you can customize a template in the form designer. To add an action container to a bar, simply add the XAF Action Container item from the [Add] button menu, and adjust its properties. See the Creating Bars and Bar Items on the Form at Design Time help topic.
To specify whether an action can be represented by a small or large button, handle the ClassicToRibbonTransformer.BarItemAdding event and set the BarItem.RibbonStyle property as required.
Thanks,
Michael.
Michael,
Sorry to ask this, but I think that I will need more explanations on this subject.
Can you point me to a document that explains the differences between XAF Action Container, XAF Menu Action Container, XAF Link Container and XAF Menu ?
When I add an action to a controller, I define its Category property so it's placed in the correct menu (standard view) or page (ribbon view).
How do I define the category associated to the XAF Action container I just created in my template so I can select it in the Category property of my action ?
Creating custom menu or ribbon is, I think, a fairly common task. I find it a bit difficult for the XAF newbie. A KB Article or a video could help us a lot.
Thank you very much for your valuable help,
Julien
Hi Julien,
Some of these classes are described in the Action Containers help topic. XafBarLinkContainerItem is a base class for XAF container items, which should not be used. MainMenuItem is the BarSubItem class descendant, that has an additional VisibleInRibbon property.
Use the ActionContainerBarItem.ContainerId property, to specify the action category this container represents.
We will improve our documentation regarding new template customization capabilities.
Thanks,
Michael.
Hi Michael,
Attached you'll find a test project.
In standard mode :
The Toolbar I created in the MainForm template is not visible.
The 2 actions are not displayed int the container.
In ribbon mode, I would like to have a page named Articles, and in this page a group named "Détails articles" containing my actions.
I just don't succeed, whatever thing I try …
Many thanks for your help.
Julien
Hi Julien,
Thank you for posting your project to us. I have found several problems in it:
Attached is a modified project. Please let us know if this makes sense.
However, it seems that I found a bug in XAF Ribbon UI. I have registered a separate report about it: Templates - Duplicate Actions in Ribbon UI under certain circumstances.
Thanks,
Michael.
Hi Michael,
It took me a lot of time to find why it was working in my sample and not in my real application.
Please define the UIType option to TabbedMdi in your last project and the custom actions are not created.
Thanks for your help,
Julien
Hi Julien,
In MDI mode the MainForm template is used only as a container for child forms, and its bars or Ribbon merge actions from child forms. To solve your problem, create a custom DetailViewForm template, and add same action containers to it.
Thanks,
Michael.
Michael,
I really hope the next XAF version will greatly simplify this problem. Please keep in mind that using a ribbon is becoming the standard way of creating application.
I created a DetailViewForm template as you suggested. The menu appears in standard mode but not in ribbon mode.
You will agree with me, but this task (adding actions in a menu) should be trivial. And it's not.
You have to create at least 2 templates. This means that if I want to add another menu (and it's very likely to happen in a complexx application) I have to update all my templates. If I make the smallest mistake (in the category Id for example), my application won't work as expected.
Can you please provide me with a small sample showing how to add an action. I would like it to work in every possible scenarii (Standard or Ribbon; MultipleWindowSDI, SingleWindowSDI, StandardMDI, TabbedMDI). I just don't want my user discover that his menu disapear when he change a small option in his model.
Many thanks for your patience,
Julien
We are working on your issue and will answer you as soon as possible. We are sorry for the delay.
Hi Julien,
I have added an action container to a custom DetailViewForm template, and it works fine for me in all modes. Attached is a modified project. Please verify that your custom action container is included in the ActionContainersManager.ActionContainerComponents collection.
Thanks,
Michael.