Current filter:
                                You should refresh the page.
                                  • Hello DevExpress,

                                    I used an ActionContainerViewItem to place an action in a detail view (see attached picture).
                                    I would like to use the 32x32 image for the button and set the font size as bold for the button caption.

                                    Any easy way to accomplish this ?

                                    Many Thanks,
                                    Julien

                                Hello Julien,

                                Thank you for contacting us. Presently, you can customize the required ActionContainerViewItem with the help of a controller:

                                [C#]
                                using System; using System.Drawing; using DevExpress.ExpressApp; using DevExpress.XtraEditors; using DevExpress.ExpressApp.Utils; using FeatureCenter.Module.Actions; using DevExpress.ExpressApp.Editors; using DevExpress.ExpressApp.Win.Editors; using DevExpress.ExpressApp.Win.Templates.ActionContainers; namespace FeatureCenter.Module.Win { public class CustomizeWinActionContainerViewItemController : ViewController<DetailView> { public CustomizeWinActionContainerViewItemController() { TargetObjectType = typeof(DetailViewActionsObject); } protected override void OnActivated() { base.OnActivated(); foreach (WinActionContainerViewItem item in View.GetItems<WinActionContainerViewItem>()) { if (item.Id == "DetailViewActions") item.ControlCreated += item_ControlCreated; } } private void item_ControlCreated(object sender, EventArgs e) { ((ButtonsContainer)((ViewItem)(sender)).Control).ActionItemAdding += CustomizeWinActionContainerViewItemController_ActionItemAdding; } void CustomizeWinActionContainerViewItemController_ActionItemAdding(object sender, ActionItemEventArgs e) { if (e.Item.Action.Id == "SimpleAction") { SimpleButton button = (((ButtonsContainersSimpleActionItem)e.Item).Control) as SimpleButton; if (button != null) { if (!string.IsNullOrEmpty(e.Item.Action.Model.ImageName)) button.Image = ImageLoader.Instance.GetLargeImageInfo(e.Item.Action.Model.ImageName).Image; button.Font = new Font(button.Font, FontStyle.Bold); } } } } }
                                I tested this example code with the FeatureCenter demo. You will probably have to additionally modify it (e.g. adjust the item's height, etc.) to meet your exact business requirements.
                                Please let us know if you need any further assistance.

                                Thanks,
                                Dennis

                                Hello Dennis,

                                I decided to extend the model so it's easier to customize such actions.

                                [C#]
                                public interface IGrandesIcôneActionContainerViewItemExtender { bool GrandesIcône { get; set; } } public sealed partial class WilLowXaf : ModuleBase { public WilLowXaf() { InitializeComponent(); } public override void ExtendModelInterfaces(ModelInterfaceExtenders extenders) { base.ExtendModelInterfaces(extenders); extenders.Add<IModelActionContainerViewItem, IGrandesIcôneActionContainerViewItemExtender>(); } }

                                How do I access the GrandesIcône property of the ActionContainerViewItem in the CustomizeWinActionContainerViewItemController_ActionItemAdding method ?

                                many thanks in advance,
                                Julien

                                Hello Julien,

                                I see you want to perform customizations only if your custom model property is set true for the current View Item. In this scenario, it is better to check if the GrandesIcône is true before subscribing the ControlCreated event:

                                [C#]
                                protected override void OnActivated() { base.OnActivated(); foreach (WinActionContainerViewItem item in View.GetItems<WinActionContainerViewItem>()) { if (((IGrandesIcôneActionContainerViewItemExtender)(item.Model)).GrandesIcône) item.ControlCreated += item_ControlCreated; } }

                                Thanks,
                                Konstantin B