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

How to make the WPFPropertyGrid Readonly.

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

    How to make the WPFPropertyGrid Readonly.

    HI there,

    I have read this post regarding use of the WPFPropertyGrid in NT and have managed to get this sample working in NT8:


    I have a question regarding how to make it read-only. I can see from a chart in the Indicators dialogue when you select an Indicator in the "Available" section it shows the properties of that indicator in the WPFPropertyGrid as read-only. This is exactly what I want to do.

    I have tried to use the PropertyGrid.ShowReadOnlyProperties property setting it to true, but it does not seem to make any difference.

    Can you provide a code sample as to how you are making the WPFPropertyGrid read-only.

    Thank for your time,

    Mark.

    #2
    Hello,

    Thank you for the post.

    If you are trying to disable the whole property grid at once, I am unsure of a specific way to disable all properties at once I will need to research this further. If I can locate any method to do this I will update this post.

    One example I can think of that would work for this purpose would be to use the property descriptor collection and a type converter. We have a good sample at the following link that demonstrates a few different concepts in the property grid including read only. https://ninjatrader.com/support/foru...ad.php?t=97919

    In this situation, a type converter is used along with the property descriptors collection to control the various properties like read-only. You could do something similar to this or create a type converter that controls all properties instead of being specific. I am unsure of what would be required to toggle that though, you would likely need to create a second object that does not have the type converter and select that if it should be enabled at some point.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      wpfpropoertygrid

      Isn't it just a simple call in initialize.. like

      wpfgrid.SelectedObject = myobject;

      foreach (PropertyItem p in wpfgrid.Properties) {

      p.IsReadOnly=true;

      }


      Good luck

      Andreas

      Start trading with Exness, a leading platform offering low spreads, advanced tools & a wide range of assets. Open your account today!

      Comment


        #4
        Thanks for the response. Much appreciated.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CortexZenUSA, Today, 12:53 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by CortexZenUSA, Today, 12:46 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by usazencortex, Today, 12:43 AM
        0 responses
        5 views
        0 likes
        Last Post usazencortex  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,266 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X