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

Ninja properties grid

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

    Ninja properties grid

    Remember that thread where I asked for help on implementing a TreeView and together we figured it out? http://ninjatrader.com/support/forum...ad.php?t=83864

    When the user clicks on a node in the tree, I want to bring up a property grid that has various properties associated with that particular tree node. I found three free ones on the web. The one that looks the nicest is the one from CodePlex and I got it to work great when you put the strategy on a chart. The properties loaded and changed and saved and did everything nicely. But when you put the same strategy on another chart, the property grid was unresponsive - no properties loaded on the second chart. The WPFPropertyGrid provided a clue. When you brought up the strategy on a second chart and invoked the GUI, you got an error message something to the effect that you can't use this control because another process owns it. I don't remember exactly but it's the same message you get when you try to implement a button on the toolbar without wrapping the calls in "this.Dispatcher.Invoke((Action)(() => }));" The one from SoftFluent works OK and even works in multiple instances but there are some annoying quirks with that one.

    I'd consider buying one but it's difficult to tell if it will actually work and since none of the free ones have a color picker I'm not sure any one that I'd pay for would either.

    Is there any way I can talk you into making the Ninjatrader properties grid available to someone who wants to inherit from it or outright use it? Or is it already available and I just don't know how to access it?

    #2
    Hello,

    There would be no need to use any other property grid as NT8 already has one implemented. You can utilize most of the same controls that are found in the platform, you would simply need to reference them in the NinjaScript side to use them.

    Here is a simple test I created a while back that implements a PropertyGrid in an addon, you would likely do a similar process using any other type. This does not implement a MVVM pattern, but I am certain you could migrate it into your current code just seeing a basic use example.

    To import this item:
    • First open a NinjaScript editor and reference the file: C:\Program Files (x86)\NinjaTrader 8\bin64\System.Windows.Controls.WpfPropertyGrid.dl l
    • Compile, ensure there are no errors and restart the platform to ensure the assembly is loaded.
    • Import the zip file.
    • Click New -> Sample PropertyGrid Addon
    • Click New -> Chart -> Any instrument and any settings
    • Add any indicator to the chart
    • Now in the addon window, click Refresh. Likely you will get a "collection source can not be modified" error, ignore this and you should see the object displayed in the property grid.





    This is not a complete sample and is not intended to be, this was simply a test if you could utilize a PropertyGrid which demonstrates the needed syntax.

    A reference to the file C:\Program Files (x86)\NinjaTrader 8\bin64\System.Windows.Controls.WpfPropertyGrid.dl l is included as a reference, but would be required for any custom project that utilizes the property grid.

    For completeness, there are some additional samples for this specific grid at this github. Some of these will work in NT8 while others may not, looking in the samples there can be additional xaml required for some of the items which may or may not be in NT8. https://github.com/DenisVuyka/WPG/tree/master/Samples

    Please let me know if I may be of further assistance.
    Attached Files
    Last edited by NinjaTrader_Jesse; 07-14-2016, 08:47 AM. Reason: added link to additional samples
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello,

      There would be no need to use any other property grid as NT8 already has one implemented. You can utilize most of the same controls that are found in the platform, you would simply need to reference them in the NinjaScript side to use them.

      Here is a simple test I created a while back that implements a PropertyGrid in an addon, you would likely do a similar process using any other type. This does not implement a MVVM pattern, but I am certain you could migrate it into your current code just seeing a basic use example.

      Please let me know if I may be of further assistance.
      That's the ticket! And it has a color picker too!
      Thanks!!!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cre8able, Today, 01:16 PM
      2 responses
      9 views
      0 likes
      Last Post cre8able  
      Started by chbruno, 04-24-2024, 04:10 PM
      3 responses
      48 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by samish18, Today, 01:01 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by WHICKED, Today, 12:56 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by WHICKED, Today, 12:45 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X