Ticket T695745
Visible to All Users

ShowViewInPopUpWindow loses window when try to open record for ListViews

created 6 years ago (modified 6 years ago)

I add controller to force open specyfic listview after opening applicationlike described here:
https://www.devexpress.com/Support/Center/Question/Details/K18099/how-to-show-a-specific-view-at-application-startup-right-after-the-logon-window-or-after

Instead DetailView i want to show ListView:

C#
public class CustomWinShowStartupNavigationItemController : WinShowStartupNavigationItemController { protected override void ShowStartupNavigationItem(ShowNavigationItemController controller) { base.ShowStartupNavigationItem(controller); ((WinWindow)Application.MainWindow).Form.BeginInvoke(new MethodInvoker(() => { IObjectSpace os = Application.CreateObjectSpace(); //object theObjectToBeShown = os.FindObject<Contacts>(null); //DetailView view = Application.CreateDetailView(os, theObjectToBeShown, true); //view.ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.Edit; DevExpress.ExpressApp.View view = Application.CreateListView(os, typeof(Contacts), true); Application.ShowViewStrategy.ShowViewInPopupWindow(view); })); } }

The List View opening but:

  1. There no ribbon buttons

  2. when i click on any record the list is closed and okDelegate is fired.

  3. there are 2 buttons Ok and Cancel - these buttons are usefull for detailview, but for ListView or Dashbord doesnt
    questions are:

  4. How to show ribbon for this list view with coresponding for list view actions ?

  5. How to allow to edit selected records after double click instead closing window  (maybe after resolving q1  this problem disaapear too)?

  6. How to hide ok/cancel butons depending on view type ?

Comments (1)
Andrey K (DevExpress Support) 6 years ago

    Hello,

    We need additional time to answer your question.

    Thanks,
    Andrey

    Answers approved by DevExpress Support

    created 6 years ago (modified 6 years ago)

    Hello,

    Please clarify why you need to show a list view in such a way. In case you are solving the same task as you described in the T693829: Open nonXaf window with dedicated view thread, please await our answer in it (we will answer it is soon).

    If you need to show a regular XAF view in a separate modal window, use the ShowViewStrategyBase.ShowView method with the following parameters:

    C#
    using DevExpress.ExpressApp; using dxT695745.Module.BusinessObjects; using DevExpress.ExpressApp.Win.SystemModule; using DevExpress.ExpressApp.SystemModule; using System.Windows.Forms; using DevExpress.ExpressApp.Win; namespace dxT695745.Module.Win.Controllers { public class CustomWinShowStartupNavigationItemController : WinShowStartupNavigationItemController { protected override void ShowStartupNavigationItem(ShowNavigationItemController controller) { base.ShowStartupNavigationItem(controller); ((WinWindow)Application.MainWindow).Form.BeginInvoke(new MethodInvoker(() => { IObjectSpace os = Application.CreateObjectSpace(); DevExpress.ExpressApp.View view = Application.CreateListView(os, typeof(Contact), true); var sp = new ShowViewParameters(); sp.CreatedView = view; sp.NewWindowTarget = NewWindowTarget.MdiChild; sp.TargetWindow = TargetWindow.NewModalWindow; var ss = new ShowViewSource(this.Frame, null); Application.ShowViewStrategy.ShowView(sp, ss); })); } } }

    Make sure that the IModelOptionsWin.UIType property is set to 'TabbedMDI'.

    Let us know your results.

    Thanks,
    Andrey

      Comments (3)
      JK JK
      Jacek Kosinski 6 years ago

        I looking for solution to open single view from another external program. I
        After user close this view a want to close whole application. In T693829 i get no solution, and i still investigating how to reach my goals.

        Now  my scenario is to open standard xaf app, depending on parameters open desired view in windowcontroller, next when user close view a want to close whole app.

        In suggested solution, after close view called by ShowView InPopup i can execute  code in Okdelegate or CancelDelegate.
        how to execute code after closing view openned by Showview method . I need this to close whole Xaf app?

        Andrey K (DevExpress Support) 6 years ago

          Hello,

          To catch the moment when a view is closed, use the View.Closed event.

          However, in your scenario, a much more suitable solution seems to be showing the required view directly in an XAF parent window (without showing additional windows). In case you don't need a navigation panel, hide it using the IModelRootNavigationItemsWeb.ShowNavigationOnStart option. Please clarify why this approach doesn't meet your requirements.

          We look forward to your response.

          Thanks,
          Andrey

          JK JK
          Jacek Kosinski 6 years ago

            IModelRootNavigationItemsWeb.ShowNavigationOnStart seems to be avaiable on web modules
            How to do the same in Win application ?

            Other Answers

            created 6 years ago (modified 6 years ago)

              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.