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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      284 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      177 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      172 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      263 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      216 views
      0 likes
      Last Post CarlTrading  
      Working...
      X