Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hiding Irrelevant UI Property Grid Items

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

    Hiding Irrelevant UI Property Grid Items

    I have developed a strategy with different user-selectable modes of operation. I would like to programmatically gray-out or remove UI property grid items that are irrelevant to a currently selected mode.

    This code doesn't work because there is no object reference to the non-static TradeBreakouts field, but it shows what I would like to be able to do.
    Code:
            [NinjaScriptProperty]
            [Display(Name = "Trade Breakouts", GroupName="2) Trading Parameters", Order=2)]
            public bool TradeBreakouts
            { get; set; }
    
            [RefreshProperties(RefreshProperties.All)]
            [Browsable(TradeBreakouts)]
            [NinjaScriptProperty]
            [Range(0, double.MaxValue)]
            [Display(Name="Breakout Factor", Description="Breakout entry limit price as a percentage of SD", GroupName="2) Trading Parameters", Order=3)]
            public double BreakoutFactor
            { get; set; }
    Is there a way to get values from NinjaTrader UI's property grid in this context?

    #2
    I thought this might provide the required static reference, but it also doesn't work, so apparently the static reference it provides is to the wrong object.
    Code:
            [NinjaScriptProperty]
            [Display(Name = "Trade Breakouts", GroupName="2) Trading Parameters", Order=2)]
            public bool TradeBreakouts
            { get; set; }
    
            protected static bool tradeBreakouts() {
                return TradeBreakouts;
            }
    
            [RefreshProperties(RefreshProperties.All)]
            [Browsable(tradeBreakouts())]
            [NinjaScriptProperty]
            [Range(0, double.MaxValue)]
            [Display(Name="Breakout Factor", Description="Breakout entry limit price as a percentage of SD", GroupName="2) Trading Parameters", Order=3)]
            public double BreakoutFactor
            { get; set; }

    Comment


      #3
      Hello caveat_lector,

      Thanks for opening the thread.

      Customizing the property grid will involve using TypeConverters.

      You can find an example that demonstrates how they can be used with indicators and strategies below.



      We look forward to being of further assistance.

      Comment


        #4
        Thanks Jim. Exactly what I needed.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        88 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        135 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        69 views
        0 likes
        Last Post PaulMohn  
        Working...
        X