Ticket T287533
Visible to All Users
Duplicate

hide field from column chooser

created 9 years ago (modified 9 years ago)

Dear All,

I'm working to hide a field from column chooser,so i added this same class HideFromCustomizationFormController of the topic "https://www.devexpress.com/Support/Center/Question/Details/Q366279"

But i have this error:

Error 42 Default property access is ambiguous between the inherited interface members 'Public ReadOnly Default Property Item(id As String) As NodeType' of interface 'DevExpress.ExpressApp.Model.IModelList(Of DevExpress.ExpressApp.Model.IModelColumn)' and'Public Default Property Item(index As Integer) As T' of interface 'System.Collections.Generic.IList(Of DevExpress.ExpressApp.Model.IModelColumn)'.

Can you help me to resolve it?

Thank you

Answers approved by DevExpress Support

created 2 months ago

Hello,

XAF v24.2 includes a new HideInUI attribute for use within business classes. This is a simple declarative way to hide fields from ListView and DetailView, their customization forms and many other UI contexts such as the Field List of the Filter, Report and Dashboard Editor/Designer. You no longer need manual Controller-based solutions or multiple non-flexible VisibleInXXX and Browsable attributes.

24-2-xaf-control-filed-visibility-for-various-ui-contexts-declaratively@2x.png

We also unified ways to disable runtime layout customization completely - you can now use 2 CustomizationFormEnabled options (global and View-specific) instead of the former 4 options.

Refer to the following breaking change article for more information: EnableColumnChooser and CustomizationEnabled options are replaced by a common cross-plarform option CustomizationFormEnabled.

Best regards,
Herman

    created 9 years ago (modified 9 years ago)

    Hi Pauline,

    This problem is described in the Error - Default property access is ambiguous thread.
    To resolve it, please modify the OnViewControlsCreated method as shown below:
    VB.NET

    Visual Basic
    Public Class HideFromCustomizationFormController Inherits ViewController(Of ListView) Implements IModelExtender Private Sub ExtendModelInterfaces(ByVal extenders As ModelInterfaceExtenders) Implements IModelExtender.ExtendModelInterfaces extenders.Add(GetType(IModelMember), GetType(IModelMemberShowInCustomizationForm)) End Sub Protected Overrides Sub OnViewControlsCreated() MyBase.OnViewControlsCreated() Dim listEditor As ColumnsListEditor = TryCast(View.Editor, ColumnsListEditor) If listEditor IsNot Nothing Then For Each column As ColumnWrapper In listEditor.Columns Dim list As IModelList(Of IModelColumn) = CType(View.Model.Columns, IModelList(Of IModelColumn)) Dim modelMember As IModelMemberShowInCustomizationForm = CType(list(column.Id).ModelMember, IModelMemberShowInCustomizationForm) column.ShowInCustomizationForm = modelMember.ShowInCustomizationForm Next column End If End Sub End Class

    We look forward to your reply once you’ve had the opportunity to implement our suggestion.

      Comments (2)
      P P
      Pauline Abou haidar 9 years ago

        Thank you a lot,it's working!

        DevExpress Support Team 9 years ago

          Hi Pauline,

          I am happy to hear that the problem has been resolved. Thank you for letting us know of your progress. Please feel free to contact us if you have any further difficulties. We will be happy to assist you.

          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.