Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to create non-selectable readonly property grid element?

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

  • NinjaTrader_Jim
    replied
    Hello fx.practic,

    The issue reported has been confirmed as a bug and has been given the ticket ID NTEIGHT-12976. The number for this ID will be noted in the Release Notes page of the help guide when a new version of NinjaTrader gets released including a fix for this issue.

    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm

    Please let us know if we can be of further assistance.

    Leave a comment:


  • koganam
    replied
    Originally posted by fx.practic View Post
    koganam, thank You for idea.

    If just to remove setter - code not compiled.

    I made parameters in .Net 3.5 style.
    They looks in another way, but values unchangeable as I need.
    Hm. Strange. As that is the documented Microsoft method.

    ref: https://docs.microsoft.com/en-us/dot...ted-properties.

    But yes, using regular properties is a very viable way to do things.

    Leave a comment:


  • fx.practic
    replied
    Thank You, Jim.

    Leave a comment:


  • fx.practic
    replied
    koganam, thank You for idea.

    If just to remove setter - code not compiled.

    I made parameters in .Net 3.5 style.
    They looks in another way, but values unchangeable as I need.

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Thanks for the hint koganam.

    To touch on this more, the setter for the property does appear to be disabled, and the property is "read only" when the attribute is used directly, but the property's control is still "modifiable" even though the value gets reverted. This could be permissible to some, but this shows a bigger issue when using a TypeConverter to modify the property grid behavior as we seen in the example here.

    The setter cannot simply be removed without more modifications, but you could use a backing field property (like we see in NinjaTrader 7 properties) to achieve read only behavior. However, this would ultimately still provide the same behavior witnessed at the current moment.

    I've reported the matter internally, and I'll update this thread with more details as they come.

    Leave a comment:


  • koganam
    replied
    Originally posted by fx.practic View Post
    Hello.

    I need readonly parameter for strategy.

    I did it in this way:

    PHP Code:
    [ReadOnly(true)] 
    [
    Range(1int.MaxValue), NinjaScriptProperty]
    [
    GroupName "Periods"Order 1)]    
    public  
    int Period1     getset; } 
    It works correct in StartegyAnalyzer but, property still changeable when Strategies dialogue when applying strategy on chart.

    How to make property unchangeable (but visible) everywhere?
    Remove the setter from the property definition?

    Leave a comment:


  • fx.practic
    replied
    Ok, thank You. Will be waiting and monitoring this thread.

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Hello fx.practic,

    Thanks for your post.

    I would not expect the property grid behavior to be different for strategies applied to a chart vs. indicators. I am also seeing that indicators can use the ReadOnly attribute without issue in a chart, but we see the difference in behavior with strategies.

    I'm looking into this further and will keep this thread informed as this develops.

    In the meantime, I would recommend making a property private if you do not want it to be modifiable.

    Thanks for your patience while we look into the ReadOnly attribute further.

    Leave a comment:


  • How to create non-selectable readonly property grid element?

    Hello.

    I need readonly parameter for strategy.

    I did it in this way:

    PHP Code:
    [ReadOnly(true)] 
    [
    Range(1int.MaxValue), NinjaScriptProperty]
    [
    GroupName "Periods"Order 1)]    
    public  
    int Period1     getset; } 
    It works correct in StartegyAnalyzer but, property still changeable when Strategies dialogue when applying strategy on chart.

    How to make property unchangeable (but visible) everywhere?
    Last edited by fx.practic; 06-21-2018, 12:59 PM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by BGWTEX, Today, 07:20 PM
0 responses
3 views
0 likes
Last Post BGWTEX
by BGWTEX
 
Started by hayleeabb, Today, 04:21 PM
1 response
5 views
0 likes
Last Post NinjaTrader_ShawnB  
Started by mg.watts, Today, 03:17 PM
1 response
17 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by JTizz, Today, 01:20 PM
1 response
8 views
0 likes
Last Post NinjaTrader_Jesse  
Started by omermirza, Today, 12:39 PM
2 responses
13 views
0 likes
Last Post omermirza  
Working...
X