Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Collapse Property Grid Groups

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Collapse Property Grid Groups

    As I add more and more properties to my strategy I'd like to programmatically collapse some of the groups by default. Is there a way to accomplish this?
    Thanks

    #2
    Hello RandomTask,

    The ability to collapse certain groups is not possible, you can use the unsupported property to collapse all groups in the cases where that works.
    Good afternoon, everyone. Who can help me with my problem? i have created a lot of settings in my strategy. unfortunately the clarity of the menu has been lost. how is it possible to set the different categories to closed by default when loading the strategy, so that the individual categories have to be opened manually, if


    You can also see this sample which uses a type converter, in that use case a custom class could be used which could have the property added to that class to close just the properties in that class. https://ninjatrader.com/support/help...r_to_custo.htm

    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      RandomTask Working with Property Grids, you probably already know that the WpfPropertyGrid class contains a collection of CategoryItem in Categories, and a collection of PropertyItem in Properties. These two types have a bool IsExpanded that can be used to achieve expand/collapse functionality. Something like this works for me:
      Code:
      for (int i = 0; i < propgrid.Properties.Count; i++)[INDENT]propgrid.Properties[i].IsExpanded = <true or false, as you wish>;[/INDENT]
       
      for (int i = 0; i < propgrid.Categories.Count; i++)[INDENT]propgrid.Categories[i].IsExpanded = <true or false, as you wish>;[/INDENT]
      Hope that helps.
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      Comment


        #4
        jeronymite
        Can I ask how you get the propgrid property?

        Comment


          #5
          Mindset In the example I provided, propgrid is a PropertyGrid object in the System.Windows.Controls.WpfPropertyGrid namespace​ that you declare and manage. It's an implementation of the WPF PropertyGrid Control originally created by Denis Vuyka.

          Thanks.
          Multi-Dimensional Managed Trading
          jeronymite
          NinjaTrader Ecosystem Vendor - Mizpah Software

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by quantismo, Yesterday, 05:13 PM
          2 responses
          15 views
          0 likes
          Last Post quantismo  
          Started by maybeimnotrader, Yesterday, 05:46 PM
          4 responses
          23 views
          0 likes
          Last Post maybeimnotrader  
          Started by frankthearm, Today, 09:08 AM
          6 responses
          25 views
          0 likes
          Last Post frankthearm  
          Started by adeelshahzad, Today, 03:54 AM
          5 responses
          33 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by stafe, 04-15-2024, 08:34 PM
          7 responses
          32 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X