This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, I have ObservableDictionary assigned to ItemsSource property of PropertyGrid. How can I make some nodes in grid as read only? |
|
|
At the moment, the only way to do this is to specify PropertyEditors (with the template identified by the PropertyGrid.ReadOnlyDisplayKey) for each entry you want to make read-only. If this set is static, you can do this in the XAML; if you have to figure out which entries are read-only at runtime, say as you are loading the dictionary entries from your data source, then you can do it in code. This will look something like: foreach (Entry entry in myDataSource) |
|
|
Just to follow up on this, in the runtime case, another approach is described at http://www.mindscape.co.nz/blog/index.php/2008/04/30/smart-editor-declarations-in-the-wpf-property-grid/. |
|
|
It works fine, thanks |
|