Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hello,

                                    I'm trying to create ribbon items from config to have a dynamic ribbon. In the case I want a ParSplitButtonItem, I pass to my code a description containing a Type instance of the EditSettings class representing the editor I want to embbed in the popup of the bar button.

                                    I do same thing with BarEditItem, and I create the bar item with (part of) code like this:

                                    BarEditItem bei = new BarEditItem ()
                                    {
                                    Content = Libelle + " :",
                                    DataContext = iril.DataContext,
                                    Hint = Tooltip,
                                    Name = String.Format ("bei{0}_{1}", iril.Tag, Tag),
                                    EditSettings = Activator.CreateInstance (settings) as DevExpress.Xpf.Editors.Settings.BaseEditSettings
                                    };

                                    and it works fine.

                                    For BarSplitButtonItem, I not found EditSettings property , and PopupControl cannot be initialized with code like this:

                                    PopupControl = new PopupControlContainer () { PopupContent = Activator.CreateInstance (???) as s ????}

                                    How can I "translate" my EditSettings type instance to a n editor that I can affect to the PopupControl property?

                                    Thanks in advance,

                                    Bruno

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                Hi Bruno,

                                You can put any visual object into the PopupControlContainer.Content property. For instance:

                                	
                                [C#]
                                SpinEdit popupContent = (SpinEdit)Activator.CreateInstance(typeof(SpinEdit)); popupContent.Width = 200; popupContent.Height = 70; BarSplitButtonItem bt = new BarSplitButtonItem() { Content = "SplitItem", PopupControl = new PopupControlContainer() { Content = popupContent } };

                                I have attached a sample project to demonstrate this approach. Please review it and let me know if you need further assistance.

                                SilverlightApplication2.zip
                                • BRUNO DELUARD 01.21.2013

                                  Yes, I tested this solution by myself. But I shoud prefer to use a solutioon absed on a xxxSettings class type to pass as a parameter more than a xxxEdit class type. And I search a way to instanciate an editor from its settings class : I suppose it is possible becasue this is the way used in gridcontrol to create editors?

                                  Thanks for any solution.

                                  Bruno

                                • Yes, it is possible to create an editor using EditSettings. I suggest you use the BaseEditSettings.CreateEditor method:

                                      public class DefaultEditorViewInfo : IDefaultEditorViewInfo {
                                          public HorizontalAlignment DefaultHorizontalAlignment {
                                              get { return HorizontalAlignment.Left; }
                                          }
                                      }
                                  SpinEdit popupContent = (SpinEdit)((BaseEditSettings)Activator.CreateInstance(settings)).CreateEditor(new DefaultEditorViewInfo());
                                  

                                • BRUNO DELUARD 01.21.2013

                                  Ok!! it is using the DefaultEditorViewInfo class which was missing fore me :)
                                  Thanks for your answer!
                                  Bruno

                                • You are welcome!

                                You must  log in  or  register  to leave comments

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners