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

                                    I need programmatically change default DetailView which will be open when user uses Ctrl+Shift+click to open a object.

                                    If I open differend DetailView from ListView I use CustomProcessSelectedItem action from ListViewProcessCurrentObjectController.

                                    But when is used Ctrl+Shift+click I don't know which controller use.

                                You must  log in  or  register  to leave comments

                                2 Solutions

                                Creation Date
                                Rating
                                Importance
                                Sort by
                                0

                                Hello,

                                You can override the OpenObject method of the DevExpress.ExpressApp.Win.SystemModule.OpenObjectController class. Please refer to its source code for more details.
                                Let us know if we can assist you further.

                                • Vit Kocmanek 08.20.2012

                                  I found this article http://www.devexpress.com/Support/Center/p/Q103790.aspx and change source code which I found in the article to this:
                                  public partial class OpenObjectFrom_VController : DevExpress.ExpressApp.Win.SystemModule.OpenObjectController
                                      {
                                          public OpenObjectFrom_VController()
                                          {
                                              InitializeComponent();
                                              RegisterActions(components);
                                          }

                                          protected override void OpenObject(SimpleActionExecuteEventArgs e)
                                          {
                                              object obj = ReflectionHelper.GetMemberValue(e.CurrentObject, "LicensedDealer");
                                              if (View.Id == "Assurance_DetailView" && obj is DealerMLM)
                                              {
                                                  ObjectSpace OS = (ObjectSpace)Application.CreateObjectSpace();

                                                  e.ShowViewParameters.CreatedView = Application.CreateDetailView(OS, "Person_DetailView", false, OS.GetObject(((DealerMLM)obj).GetPerson));
                                                  DevExpress.ExpressApp.Win.Core.BindingHelper.EndCurrentEdit(System.Windows.Forms.Form.ActiveForm);
                                              }
                                              else
                                              {
                                                  base.OpenObject(e);
                                              }
                                          }
                                      }

                                  This is nice: object obj = ReflectionHelper.GetMemberValue(e.CurrentObject, "LicensedDealer"); but in my case I need modify action of many Controls of detailview, not only "LicensedDealer". All Controls are based on DealerMLM and have different names.
                                  Is possible to get object of property which is clicked by user?

                                You must  log in  or  register  to leave comments
                                0

                                I found this article http://www.devexpress.com/Support/Center/p/Q103790.aspx and change source code which I found in the article to this:

                                	
                                [C#]
                                DevExpress.ExpressApp.Win.SystemModule.OpenObjectController { public OpenObjectFrom_VController() { InitializeComponent(); RegisterActions(components); } protected override void OpenObject(SimpleActionExecuteEventArgs e) { object obj = ReflectionHelper.GetMemberValue(e.CurrentObject, "LicensedDealer"); if (View.Id == "Assurance_DetailView" && obj is DealerMLM) { ObjectSpace OS = (ObjectSpace)Application.CreateObjectSpace(); e.ShowViewParameters.CreatedView = Application.CreateDetailView(OS, "Person_DetailView", false, OS.GetObject(((DealerMLM)obj).GetPerson)); DevExpress.ExpressApp.Win.Core.BindingHelper.EndCurrentEdit(System.Windows.Forms.Form.ActiveForm); } else { base.OpenObject(e); } } }

                                This is nice: object obj = ReflectionHelper.GetMemberValue(e.CurrentObject, "LicensedDealer"); but in my case I need modify action of many Controls of detailview, not only "LicensedDealer". All Controls are based on DealerMLM and have different names.
                                Is possible to get object of property which is clicked by user?

                                • Yes, it is possible.
                                  Please see how the methods below are implemented and used in the OpenObjectController.cs file:
                                  private Object FindObjectToOpen(int mouseX, int mouseY)
                                  private Object FindObjectToOpen(GridColumn column, int rowHandle)
                                  I hope you find this information helpful.

                                • Vit Kocmanek 09.05.2012

                                  My final solution is in attachment file.

                                • Thank you for posting your final code here. It will be helpful for other Support Center users.

                                You must  log in  or  register  to leave comments
                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.

                                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.

                                Your Privacy - Legal Statements

                                Copyright © 1998-2013 Developer Express Inc.
                                ALL RIGHTS RESERVED
                                All trademarks or registered trademarks
                                are property of their respective owners