Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Properties with ReadOnly Attribute Not Showing in Drawing Tool

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

    Properties with ReadOnly Attribute Not Showing in Drawing Tool

    I've created a couple of custom drawing tools and added a ReadOnly attribute to a ToolVersion Property.
    Code:
    [ReadOnly(true)]
    [Display(Name = "Tool Version", GroupName = "Version", Order = 0)]
    public string ToolVersion { get; set; }
    This ReadOnly Property does not show up in the Drawing Tool Properties Dialog. Is this expected? or a bug?

    Thanks,
    Greg
    The Trading Mantis
    NinjaTrader Ecosystem Vendor - The Trading Mantis

    #2
    Hello gregschr,

    I took a look at the given code and I also see that this does not work in a drawing object. unfortunately the ReadOnly attribute is not documented so I am not sure if that is to be expected in a drawing object.

    For a drawing object you can make a non editable property by incorrectly using the get/set for the property:

    Code:
    private string version = "1";
    [Display(Name = "Tool Version", GroupName = "General", Order = 0)]
    public string ToolVersion { get { return version;  } set { }}
    The user could edit the version but when the focus leaves the input field the private varaible value is used and replaces what the user typed.

    Comment


      #3
      A kludge will have to do... Thx for the confirmation

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      592 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      554 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X