Ticket T833980
Visible to All Users

Layout control customization

created 5 years ago (modified 5 years ago)

[DevExpress Support Team: CLONED FROM S135134: How do I provide the capability to collapse or expand layout groups and persist their state?]

Hi Dennis.
I am researching your code sample (the implementation of ExpandableLayoutGroupViewController) as well as some other related code samples (see Q101774Q582278) and also read the document Access Layout Control. Everywhere is used sligthly different ways of accessing LayoutControl's items and it's a little confusing.

  1. Can you please explain why you initialize "expand-collapse" feature of layout groups within HandleCreated event handler? It looks very unusual. Why don't you do it just within ViewControlsCreated handler as stated in Access Layout Control document? What's the purpose of your approach?
  2. Also I wonder why you access LayoutControl through View.LayoutManager.Container but not through View.Control?
  3. And the last question. It's unclear why you first gather things into collection (itemToWinModelLayoutGroupExtenderMap) and then do the main initialization (i.e. set ExpandButtonVisible, Expanded etc. properties) in a separate step. Why not do all this job at once utilizing single event handler either WinLayoutManager.ItemCreated or HandleCreated/ViewControlsCreated?

Thanks in advance

Comments (1)
DevExpress Support Team 5 years ago

    Hi Sargis,

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

    Answers approved by DevExpress Support

    created 5 years ago

    Hi Sargis,

    Thank you for your patience.

    Can you please explain why you initialize "expand-collapse" feature of layout groups within HandleCreated event handler?
    It's unclear why you first gather things into collection (itemToWinModelLayoutGroupExtenderMap) and then do the main initialization (i.e. set ExpandButtonVisible, Expanded etc. properties) in a separate step. Why not do all this job at once utilizing single event handler either WinLayoutManager.ItemCreated or HandleCreated/ViewControlsCreated?

    In the latest version, we implemented several performance improvements, including the lazy initialization of controls in the LayoutControl. That is why we cannot use the ViewControlsCreated event, which occurs too early.

    why you access LayoutControl through View.LayoutManager.Container but not through View.Control

    The View is not completely initialized when the OnActivated method is called. That is why we cannot use the View.Control property.

      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.