Ticket S139747
Visible to All Users
Duplicate

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

WinForms - It is difficult to distinguish between fields with the same name in Customization Forms

How to show a full member path in the LayoutControl's Customization Form to avoid similar captions for properties with the same last member

created 13 years ago

When dealing with complicated detailviews, often we have repeating fields, especially when dealing with weekly information. Thus i may have 7 attributes that are Mon_DailyBlurb, Tue_DailyBlurb etc… Currently the standard is to create tabs to separate daily attribute sets. SO, we augment captions to not repeat the day component… THEN within the field chooser we have a long list of attributes that are identical. This is very very complicated and time-consuming when re-arrangements are needed.
All that is needed is to augment the field listed as FieldName (Caption) … problem solved!

Comments (3)

    This seems like a very very easy fix. My suggestion should cover all the duplicates. Tis simply the display caption that gets set, augment it as outlined, as we are good to go! Done by noon? :)

    CR CR
    Chris Royle (LOBS) 10 years ago

      Still waiting Drew ;)

      I'd be happy with a tooltip which gave some indication of property path.

      So, a +1 from me for this functionality to be implemented *formally*.

        +1 from me too

        Answers approved by DevExpress Support

        created 9 years ago (modified 5 years ago)

        It is possible to use the BaseLayoutItem.CustomizationFormText property to accomplish this task. Here is an example of how to show a dot-separated member caption including all sub-properties:

        C#
        using DevExpress.ExpressApp.Editors; using DevExpress.ExpressApp.Utils; using DevExpress.ExpressApp.Win.Layout; public class CustomizationFormCaptionController : ViewController<DetailView> { protected override void OnActivated() { base.OnActivated(); ((WinLayoutManager)View.LayoutManager).ItemCreated += CustomizationFormCaptionController_ItemCreated; } void CustomizationFormCaptionController_ItemCreated(object sender, ItemCreatedEventArgs e) { if (e.ViewItem is PropertyEditor) { e.Item.CustomizationFormText = CaptionHelper.GetFullMemberCaption(View.ObjectTypeInfo, (((PropertyEditor)e.ViewItem).MemberInfo).Name); } } protected override void OnDeactivated() { base.OnDeactivated(); ((WinLayoutManager)View.LayoutManager).ItemCreated -= CustomizationFormCaptionController_ItemCreated; } }

        Updated:

        The solution for WinForms plain list views: T906747 - How to show a full member path in the Customization Form - for list views?

        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

          Other Answers

          created 10 years ago

          Here's a hack & bodge - screenshot attached.

          C#
          using System; using System.Linq; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Editors; using DevExpress.ExpressApp.Layout; using DevExpress.ExpressApp.Win.Layout; using DevExpress.ExpressApp.Win.SystemModule; using DevExpress.XtraLayout; namespace LOB.XAF.Win.BugFixes { public class LOBWinLayoutManagerController : WinLayoutManagerController { #region LayoutControl private LayoutControl _layoutControl; protected LayoutControl LayoutControl { get { return _layoutControl; } set { if (!ReferenceEquals(_layoutControl, value)) { UnsubscribeLayoutControl(); _layoutControl = value; SubscribeLayoutControl(); } } } private void SubscribeLayoutControl() { if (this.LayoutControl != null) this.LayoutControl.ItemAdded += LayoutControl_ItemAdded; } void LayoutControl_ItemAdded(object sender, EventArgs e) { XafLayoutControlItem i = sender as XafLayoutControlItem; if (i != null && !i.CustomizationFormText.Contains('.')) { WinLayoutManager l = this.LayoutManager as WinLayoutManager; if (l != null) { ViewItem vi = l.FindViewItem(i); if (vi != null && vi.Id.Contains(".")) i.CustomizationFormText = "[" + vi.Id.Substring(0, vi.Id.IndexOf('.')) + "]." + i.CustomizationFormText; } } } private void UnsubscribeLayoutControl() { if (this.LayoutControl != null) this.LayoutControl.ItemAdded -= LayoutControl_ItemAdded; } #endregion #region DetailView private DetailView DetailView { get { return base.View as DetailView; } } #endregion #region LayoutManager private LayoutManager LayoutManager { get { if (this.DetailView != null) return this.DetailView.LayoutManager; return null; } } #endregion #region OnActivated protected override void OnActivated() { base.OnActivated(); this.LayoutControl = (XafLayoutControl)this.LayoutManager.Container; if (this.LayoutControl == null) base.View.ControlsCreated += this.View_ControlsCreated; } #endregion #region OnDeactivated protected override void OnDeactivated() { base.OnDeactivated(); this.LayoutControl = null; } #endregion #region View_ControlsCreated private void View_ControlsCreated(object sender, EventArgs e) { base.View.ControlsCreated -= this.View_ControlsCreated; this.LayoutControl = (XafLayoutControl)this.LayoutManager.Container; } #endregion } }
            Comments (1)
            W W
            Willem de Vries 8 years ago

              Xafari (GalaktikaSoft) has a nice feature built in to take care of this. Plus a small extension in the model editor to dis/enable the way the caption is calculated on a per property basis. I love it!

              Additionally, they have a way to deal with complex detailviews by using a small in-view navigation that shows separate detailviews inside the original detailview. Looks promising too! It also allows you to reuse properties in the 'same detailview' .

              And they provide decent documentation !

              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.