Announcement

Collapse
No announcement yet.

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.

    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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          66 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          141 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          46 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          51 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X