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 DannyP96, 05-18-2026, 02:38 PM
      1 response
      85 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      143 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      83 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      256 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      334 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X