Ticket T669778
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

Show/hide a detailview when MasterDetailMode = ListViewAndDetailView

Hide ListView in MasterDetailMode ListViewAndDetailView (Win XAF application)

created 7 years ago (modified 7 years ago)

Dear Support members,

I have Win XAF application, with an XPO data model that implements programmatically data versioning through table relationships.
As a consequence, I use ListViews with MasterDetailMode set  to "ListViewAndDetailView", with list views showing the versioning records (basically date and user) and the corresponding object details in the DetailView.
All this works perfectly well.

But the point is end-users would like to hide the versioning history for normal use.

Ideally, I would love to have a docking panel where versioning (e.g. listview) can be hidden or displayed when necessary. But I couldn't achieve this, as it seems way too complex.

So I tried to hide the ListView through a controller (gridView.GridControl.Hide();), but then the detailView is empty.

Alternatively I tried to put the size (either width or height) to zero, or to change the height to display only one row, but it just doesn't work :

C#
System.Drawing.Size myMinSize = gridView.GridControl.MinimumSize; myMinSize.Height = 5; gridView.GridControl.Height = 5;

I spent a lot of time digging in the forum but I couldn't find suitable information.

Help would be much appreciated!
Thanks,
Philippe

Comments (1)
DevExpress Support Team 7 years ago

    Hello Philippe,

    We need additional time to answer your question. Please bear with us. We will get back to you as soon as possible.

    Answers approved by DevExpress Support

    created 7 years ago (modified 4 years ago)

    Hello Philippe,

    Your scenario looks very similar to opening DetailView from a master-detail ListView in a Tabbed MDI UI.

    Alternatively, if you are not using Light Style, you can use the solution from the Switch between ListViewOnly and ListAndDetailView ticket and change the SplitPanelVisibility.Panel1 value by the SplitPanelVisibility.Panel2  value in the following line:

    C#
    ((SplitContainer)View.LayoutManager.Container).PanelVisibility = cost.IsStock ? SplitPanelVisibility.Both : SplitPanelVisibility.Panel1;

    Note that GridListEditor does not assign a data source to the grid if the grid is hidden. You can show and hide FixedPanel in the RefreshAction.Execute event handler to force a data source update.

    Let me know if these solutions are suitable for you.

    Thanks,
    Marina

      Show previous comments (6)

        Hi Marina,

        thank you for your comment. Toggling the listview off and on is OK (in my code I always hide them off but I think I will add the SimpleAction as you did)

        The point is once the panel is hidden : my business object logic clones the last object when a change is entered (from the detailview property editors) and object is saved, adding a new one with updates. This works fine as long as I don't hit the "Refresh" button, which then shows a DetailView with empty fields.

        Is it a behaviour you can reproduce with your example?

        FYI my current controller's code

        C#
        private void View_CurrentObjectChanged(object sender, EventArgs e) { if (View is CompositeView && View.LayoutManager != null) { SidePanelContainer container = View.LayoutManager.Container as SidePanelContainer; if (container != null) { if (true) { container.FixedPanel.Visible = false; container.FixedPanel.Width = container.FixedPanel.MinimumSize.Width; } } } }
        DevExpress Support Team 6 years ago

          Hi Phil,

          We need additional time to research this issue. Please bear with us. We will get back to you as soon as possible.

          DevExpress Support Team 6 years ago

            Hello Philippe,

            GridListEditor does not assign a Data Source to the Grid if the Grid is hidden. You can show and hide FixedPanel in the RefreshAction.Execute event handler to force Data Source update.

            Thanks,
            Marina

            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.