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

Property Grid...

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

    Property Grid...

    In my custom indicator, I would like to add a drop down list to a property so I use can select from 3 options. Can someone point me in the direction on how this is done please?

    For instance:

    [XmlIgnore()]
    [Description("Description here")]
    [GridCategory("Category here")]
    [Gui.Design.DisplayNameAttribute("Display name here")]
    public int MyProperty
    {
    get { return myProperty; }
    set { myProperty = value; }
    }

    I need to create a property with drop down selections like I see in other NT indicators, Color values, etc.

    #2
    I think you need to look into using an enum as the parameter. Here is a sample provided by Ninja:



    hth,
    coolmoss

    Comment


      #3
      That's cool, thanks. But my issue is that I need to return DataGridViewContentAlignment value of either:
      MiddleLeft,
      MIddleCenter,
      MiddleRight

      Not sure the enum can do that , at least i haven't figure it out yet. What say ye?

      Comment


        #4
        Hello,

        Yes enum should be what you're looking for. For more details on its usage (in addition to the link already posted) http://www.csharp-station.com/Tutorials/Lesson17.aspx

        Please let me know if I can be of further assistance.
        LanceNinjaTrader Customer Service

        Comment


          #5
          Never imagined the enum can be used in that way. I am also confused with a similar C# property grid question, I read through the property grid tutorial but didn't find the good solution to my annoyance.

          Comment


            #6
            Hello xiaoyuandlg,

            Welcome to the NinjaTrader Support Forums!

            That is a bit out of the scope that we can support here at NinjaTrader.

            On different subjects like this you may want to start a new thread as well but I will leave this thread open incase a member of our Support Forums has worked with the "KetticPropertyGrid".
            JCNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by tkaboris, Today, 08:01 AM
            0 responses
            1 view
            0 likes
            Last Post tkaboris  
            Started by BarzTrading, Today, 07:25 AM
            1 response
            10 views
            1 like
            Last Post NinjaTrader_Clayton  
            Started by EB Worx, 04-04-2023, 02:34 AM
            7 responses
            161 views
            0 likes
            Last Post VFI26
            by VFI26
             
            Started by Mizzouman1, Today, 07:35 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Radano, 06-10-2021, 01:40 AM
            20 responses
            616 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X