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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 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
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X