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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      91 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      121 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      72 views
      0 likes
      Last Post PaulMohn  
      Working...
      X