Ticket DQ51646
Visible to All Users

Create/Destroy a Multilevel SubMenu at runtime

created 18 years ago

Hi,
did you have an example how to create and destroy a multilevel menu to an existing subitem-menu entry.
I have one dxBarSubitem and depending on the contents of a config file i want to create a tow level menu. Every time when the config file is reloaded the menu should be recreated.
I can't figure it out so easy, so i hope you have an example :-)
Greetings and thanks
Jens

Show previous comments (4)
Serge (DevExpress Support) 18 years ago

    This code is basically correct, however, I should draw your attention to the following things:

    1. Deleting an ItemLink (TdxBarItemLink) does not delete the corresponding Item (TdxBarItem), but just removes it from the menu/toolbar. If you wish to delete old Items as well, you should call the Free method for each TdxBarItem.
    2. You must utilize the LockUpdate property of the BarManager whenever you create/destroy Items, ItemLinks or Bars. The fact is that LockUpdate of a BarManager component locks any updates when you force bars to redraw themselves via the changes made to bar elements. And the LockUpdate of a Bar component locks any updates when you force the bar to reconstruct itself by hiding its items.
      You will find some articles which illustrates the use of this property in our Knowledge Base:
        https://www.devexpress.com/Support/Center/SearchResults.aspx?searchtext=LockUpdate&pgid=48409584-e723-41af-b1d3-52dd97577823&pid=07aa3ad0-3f72-4cfb-8469-6e26d1185515&default=KB
      Thanks,
      Serge
    J J
    Jens Fudickar [DX-Squad] 18 years ago

      Hi Serge,
      thanks for the last infos. This were the infos i'm looking for.
      Greetings
      Jens

      Serge (DevExpress Support) 18 years ago

        No worries, Jens. You are always welcome :)
        Thanks,
        Serge

        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.