Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Expandable property questions

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

    Expandable property questions

    Can someone point me to some good documentation on expandable properties?

    I have the basic part just fine -- they show up with a "+" sign, and can be expanded. The part I am having trouble with are how to handle default values.

    Googling around, and even the MSDN stuff I have found, seems to handle just the basics -- type converters and making the property expand. I have not found anything that talks about default values. The built-in Point property does pretty well, so it must be possible.

    Thanks,
    EV
    Last edited by ETFVoyageur; 03-19-2014, 06:38 PM.

    #2
    Hi EV, officially this would be a territory of modificiations we could not officially support, however on the property grid in general I'm aware of those resources -



    Extend a PropertyGrid with an Item collection; easy customization of properties with custom editor, custom converter and databinding.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks, Bertrand. I was just about to post a followup, so here goes.

      The basic situation is that DefaultValue works for the built-in class Point, but not for my class (Person). I have tracked the problem down quite a way, and here is what I have found:

      The following code using the property works as expected. In particular, DefaultValue.Value is set to {X=2,Y=5}
      Code:
              private Point pointProperty = new Point(2,5);
              [DefaultValue(typeof(Point), "2,5")]
      The following code has a problem -- the DefaultValue attribute gets instantiated, but its Value field is null:
      Code:
              private Person personProperty = new Person("First", "Last", 21);
              [DefaultValue(typeof(Person), "Last,First,21")]
      The following code results in DefaultValue.Value being set up correctly, but is (of course) the wrong type for the default value. The point was just to prove that the Value field could get set for a Person property.
      Code:
              private Person personProperty = new Person("First", "Last", 21);
              [DefaultValue("Last,First,21")]
      It seems clear that the default value handling does not know what to do with a Person type. Perhaps it is using Reflection, and there is something I need to do with my Person class to enable that? I have tried adding Person and InstanceDescriptor as things the TypeConverter can convert to, but that does not help.

      I have no idea how to get past this -- any help would be appreciated.

      Thanks,
      EV
      Last edited by ETFVoyageur; 03-20-2014, 06:50 AM.

      Comment


        #4
        Bertrand,

        By the way, could you please ensure that V8 does officially support expandable properties?

        Thanks,
        EV

        Comment


          #5
          When I first posted this I did not realize it was really an indicators issue. I do have a follow-up, but I'll post that where it belongs -- in the Indicators area.

          --EV

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by George21, Today, 10:07 AM
          0 responses
          4 views
          0 likes
          Last Post George21  
          Started by Stanfillirenfro, Today, 07:23 AM
          8 responses
          23 views
          0 likes
          Last Post Stanfillirenfro  
          Started by DayTradingDEMON, Today, 09:28 AM
          2 responses
          16 views
          0 likes
          Last Post DayTradingDEMON  
          Started by navyguy06, Today, 09:28 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          8 responses
          32 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X