Ticket Q335079
Visible to All Users

How to hide a Property Editor or View Item in a ViewController at runtime

created 14 years ago

How to set a propertyeditor's visibility in ViewController .

Answers

created 14 years ago (modified 4 years ago)

Hello,
Thank you for contacting us. There are several good options for this task:
1.  In DetailView, you can access a required PropertyEditor instance as per the Access Editor Settings help article and then cast it to the IAppearanceVisibility type for setting its Visibility property:

C#
using DevExpress.ExpressApp.Editors; ... ((IAppearanceVisibility)thePropertyEditor).Visibility = ViewItemVisibility.Hide; ...

Standard XAF property editors correctly implement the DevExpress.ExpressApp.Editors > IAppearanceVisibility > Visibility contract and thus, will hide the editor correctly from the layout.

2. You can reuse the built-in Conditional Appearance module APIs:
    How to: Hide the 'Protected Content' Columns in a List View and Property Editors in a Detail View
    How to: Disable and Hide Property Editors Based on a Business Rule

3. You can use VisibleInListView/VisibleInLookupListView and VisibleInDetailView attributes to mark a ListView column or a DetailView editor invisible. For more information, see List View Column Generation. It is also possible to show, hide and reorder fields at runtime in both ListView and DetailView for WinForms and WebForms/Blazor (ListView only). For more information, see List View Columns Customization and View Items Layout Customization.

Search keywords
invisible, hide, remove, visible, show, display, view, DetailView, layout, ListView, column

    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.