Ticket T906747
Visible to All Users
Duplicate

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

WinForms - How to show full member paths in customization forms

How to show a full member path in the Customization Form - for list views?

created 5 years ago (modified 5 years ago)

This ticket https://supportcenter.devexpress.com/ticket/details/s139747
shows how to modify the column captions in the Customization Form in detail views in XAF.Win.

Is there a relatively simple way to achieve the same functionality in the Customization Form for list views in XAF.Win?

(side notes)
The controller from the referenced ticket can be extended also to list views, but then (View as CompositeView).LayoutManager is not an instance of WinLayoutManager class (which has a useful ItemCreated event handler) but an instance of WinSidePanelLayoutManager. So that seems to be a dead end.

Comments (2)
Andrey K (DevExpress Support) 5 years ago

    Hello,

    If I correctly understand it, you wish to change column names in a grid control column chooser. Although XAF doesn't have a mechanism to accomplish this task, you can access the underlying grid control and use its API to change these captions. The following article should help you with accessing the grid control in an XAF app: Access Grid Control Properties.

    To give you a more precise solution, we need to know what grid control you are using. Please specify your app's technology (ASP.NET or WinForms) so that we can pass this question on to the corresponding team.

    If I misunderstood your requirements, describe them in greater detail.

    Thanks,
    Andrey

    KK KK
    Krzysztof Krzysztof 5 years ago

      Hi Andrey, sorry if I wasn't clear. I have rephrased my initial question.

      Answers approved by DevExpress Support

      created 5 years ago (modified 5 years ago)

      Hello Krzysztof,

      Thank you for the clarification. I suppose that you mean the grid control's Column Chooser. XAF shows a tooltip with a full member path for such columns: WinForms - It is difficult to distinguish fields with the same name in Customization Forms. If this is insufficient, you can change captions using the GridColumn.CustomizationCaption property. Use the following approach to access GridColumn objects: Access Grid Control Properties.

      C#
      using DevExpress.ExpressApp; using DevExpress.ExpressApp.Utils; using DevExpress.ExpressApp.Win.Editors; using DevExpress.ExpressApp.Win.SystemModule; namespace MainDemo.Module.Win { public class GridColumnChooserCaptionController : ViewController<ListView> { GridListEditor gridListEditor; bool defaultEnablePropertyPathToolTip = true; protected override void OnActivated() { base.OnActivated(); gridListEditor = View.Editor as GridListEditor; if (gridListEditor != null) { defaultEnablePropertyPathToolTip = GridEditorColumnChooserController.EnablePropertyPathToolTip; GridEditorColumnChooserController.EnablePropertyPathToolTip = false; gridListEditor.CustomizeGridColumn += GridListEditor_CustomizeGridColumn; } } private void GridListEditor_CustomizeGridColumn(object sender, CustomizeGridColumnEventArgs e) { e.GridColumn.CustomizationCaption = CaptionHelper.GetFullMemberCaption(View.ObjectTypeInfo, e.GridColumn.FieldName); } protected override void OnDeactivated() { base.OnDeactivated(); if (gridListEditor != null) { GridEditorColumnChooserController.EnablePropertyPathToolTip = defaultEnablePropertyPathToolTip; gridListEditor.CustomizeGridColumn -= GridListEditor_CustomizeGridColumn; gridListEditor = null; } } } }

      Please try this solution and let me know if the result meets your needs.

      Update:
      The solution for WinForms detail views: S139747 - How to show a full member path in the LayoutControl's Customization Form to avoid similar captions for properties with the same last member
      The solution for WinForms tree list views: T919737 - Win - Show a full member path in the Customization Form - for a TreeList
      The common solution: S30014 - WinForms - It is difficult to distinguish fields with the same name in Customization Forms

        Show previous comments (1)
        Anatol (DevExpress) 5 years ago

          Hello Krzysztof,

          To customize new columns that are created using the Column Chooser's Add button, handle the GridListEditor.CustomizeGridColumn event. I have added an example to my initial answer.

          Please let me know if you have further questions.

          KK KK
          Krzysztof Krzysztof 5 years ago

            Awasome! Thank you, Anatol. It works like a charm now.

            Anatol (DevExpress) 5 years ago

              You are welcome!

              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.