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

The type or namespace name 'Grid' could not be found

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

    The type or namespace name 'Grid' could not be found

    I try to add custom DrawingTool and try to create icon for that. I found out an example on the page https://ninjatrader.com/support/help...stom_icons.htm but when I add this example to my code I get an error:

    The type or namespace name 'Grid' could not be found (are you missing a using directive or an assembly reference?)

    What using should I add or what should I include to fix this error about Grid?
    Handlar
    NinjaTrader Ecosystem Vendor - Handlar

    #2
    Hello handlar,

    Thank you for the post.

    Did you copy the entire sample including the using statements listed? Grid would be in namespace System.Windows.Controls: Do you currently have this using statement in your script?

    Alternatively it would generally be more suggested to just use the full name for the type being used or :

    Code:
    System.Windows.Controls.Grid
    wherever "Grid" has been used.

    Code:
    System.Windows.Controls.Grid myCanvas = new System.Windows.Controls.Grid { Height = 16, Width = 16 };
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      I didn't find System.Windows.Controls.Grid in using section on the example's page here http://prntscr.com/lkjq64
      Thank you for answer. It works for me!

      P.S.
      You have 2 mistakes on this example page:
      1. You need add using System.Windows.Controls; // it needs for custom Icon for Drawing Tool, for example
      2. Here http://prntscr.com/lkjruv you should use myCanvas.Children.Add(myPath) instead of myCanvas.Children.Add(p)
      Handlar
      NinjaTrader Ecosystem Vendor - Handlar

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bmartz, 03-12-2024, 06:12 AM
      4 responses
      32 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by Aviram Y, Today, 05:29 AM
      4 responses
      12 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
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X