Announcement

Collapse
No announcement yet.

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.

    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

      Discover top crypto trading apps like Binance for secure, low-fee trading. Access crypto, forex, and more with real-time tools. Avoid scams, start small, and grow profits.

      Comment


        #4
        Thanks for the response. Much appreciated.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        553 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        100 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        543 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        546 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X