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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      54 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      25 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      17 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      23 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      24 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X