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

XAML References to Current Skin, NT8

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

    #16
    Interesting stuff...
    I'm tagging onto this thread as my query seems sort of related to BrennanSalibrici's queries re what we can use in Addons.

    I have pretty much finished an Addon... but I have spent about 3 weeks hitting my head on a brick wall... hope Jesse can provide guidance ;-)

    Actually, my Addon started as a VS Windows Forms project... works great. I thought I should convert it to an Addon... and that's where the pain began!
    I really wanted to use the Forms DataGridView control, does everything I want... but found I had to resort to WindowsFormsHost (and WindowsFormsIntegration.dll) to embed a Forms control inside a standard System.Windows.Control. Well... all that worked fine in a separate VS project, but it seems no amount of tinkering could convince the Windows form host to render in my NT Addon. No errors... I see the data in the VS debugger... but it just won't show zip.

    Tried various workarounds... DataGrid, XamDataGrid... but each one has some problem that I can't solve.

    So... bottom line: should it be possible to get the WindowsFormsHost thing to operate inside Ninja Addon code? Or is there some fundamental reason that will never work?

    Thanks,
    Let me know if you think this should be a new thread...

    T.

    PS... All of my efforts might be rendered a waste of time... if, I knew how to create the sort of grid that NT uses. Is that available to us developers?
    Cheers,
    Last edited by tgn55; 10-29-2020, 08:51 AM. Reason: Adding PS...

    Comment


      #17
      Hello tgn55,

      NT8 uses custom styles and windows which prevent using controls that require no transparency which includes the form host and web browser. You may be able to make a normal un-styled WPF window but we really have no support for using windows forms at all. NT8 was not built for use with windows forms and takes advantage of the newer WPF system and its abilities. I would generally suggest looking for an alternative control built in WPF for the purpose you needed, you could try searching online for "datagridview wpf alternative". Potentially just a DataGrid would work for the use.

      Please let me know if I may be of additional assistance.
      JesseNinjaTrader Customer Service

      Comment


        #18
        Thanks Jesse.

        I kinda already did that. The two options I tried:
        • With DataGrid, I seem unable to copy the contents (plus column headers) to the clipboard (which I was doing for the purpose of exporting to Excel): Update... scratch that... finally got this working
        • Infragistics XamDataGrid... works, I can export to Excel... but it messes with date columns, and I have yet to figure out how to stop it turning all cells with date/Time values into a calendar object.
        I would prefer if I could just use the same control as NT uses... same look and feel etc... as long as I can copy to clipboard, but it's not clear if that's proprietary.

        I have a related query re Infragistics licensing... would using their controls impact making my Addon potentially commercial product on the Ninja Ecosystem?

        Cheers,
        T.
        Last edited by tgn55; 10-29-2020, 05:52 PM.

        Comment


          #19
          Hello tgn55,

          You may be able to reuse one of the existing controls if the use case allows for that, for example an order grid or as shown in post 1 of this thread <AccountData:OrderGrid. For just a grid you could try using the information in the following post, I have personally not created anything using the Xam items so I have no experience on that type of development to know what implications may exist.
          https://ninjatrader.com/support/foru...rid#post726196

          There appears to be no restrictions for the license for internal NinjaScript items meaning imported or developed in NinjaTrader. The controls would otherwise not work for any external projects that operate outside of the platform.

          I look forward to being of further assistance.
          Last edited by NinjaTrader_Jesse; 10-30-2020, 01:00 PM.
          JesseNinjaTrader Customer Service

          Comment


            #20
            Thanks Jesse.. I think I am now on the right track... using NTGrid, which as the OP noted, is based on XamDataGrid.

            I have just one remaining issues:
            1. How to make a couple datetime fields appear as "plain" date time... same as in NT Trade Performance trades grid, and not an embedded calendar control.
            Any help appreciated.
            T.
            Last edited by tgn55; 11-03-2020, 02:13 AM.

            Comment


              #21
              Hello tgn55,

              Unfortunately this is not a documented control so I would have no details on how to modify or change the columns. The internal control likely uses some amount of code to customize the default grid however I am not able to see that type of code because its internal. You may be able to reference the documentation for the third party control through infragistics website to gather further information on how the columns can be changed in general.


              Please let me know if I may be of additional assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bmartz, 03-12-2024, 06:12 AM
              5 responses
              32 views
              0 likes
              Last Post NinjaTrader_Zachary  
              Started by Aviram Y, Today, 05:29 AM
              4 responses
              13 views
              0 likes
              Last Post Aviram Y  
              Started by algospoke, 04-17-2024, 06:40 PM
              3 responses
              28 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by gentlebenthebear, Today, 01:30 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by cls71, Today, 04:45 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X