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!
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
NinjaTrader
How to create non-selectable readonly property grid element?
Collapse
X
-
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.
-
Originally posted by fx.practic View Postkoganam, 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.
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:
-
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:
-
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:
-
Originally posted by fx.practic View PostHello.
I need readonly parameter for strategy.
I did it in this way:
PHP Code:[ReadOnly(true)]
[Range(1, int.MaxValue), NinjaScriptProperty]
[GroupName = "Periods", Order = 1)]
public int Period1 { get; set; }
How to make property unchangeable (but visible) everywhere?
Leave a comment:
-
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(1, int.MaxValue), NinjaScriptProperty]
[GroupName = "Periods", Order = 1)]
public int Period1 { get; set; }
How to make property unchangeable (but visible) everywhere?Last edited by fx.practic; 06-21-2018, 12:59 PM.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pechtri, 06-22-2023, 02:31 AM
|
9 responses
122 views
0 likes
|
Last Post Today, 02:31 PM | ||
Started by frankthearm, 04-18-2024, 09:08 AM
|
16 responses
66 views
0 likes
|
Last Post Today, 02:17 PM | ||
Started by habeebft, Today, 01:18 PM
|
1 response
5 views
0 likes
|
Last Post Today, 02:03 PM | ||
Started by benmarkal, Today, 12:52 PM
|
2 responses
15 views
0 likes
|
Last Post
by benmarkal
Today, 02:00 PM
|
||
Started by f.saeidi, Today, 01:38 PM
|
1 response
8 views
0 likes
|
Last Post Today, 01:45 PM |
Leave a comment: