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
|
I've faced with problem. When I put PropertyGrid in TreeViewItem, there is no propertyvalue column. For Example XAML:
And CodeBehind:
Then when I expand TreeViewItem there is onli property name column with key and there is no values. A. Why is this work in this manner? And next little question. B. Is this good practice to set ItemSource in Window_Loaded event handler? (I ask this because if window contain so much PropertyGrids then when windows is loading I can see work of masure arrange phase and gradual changing the width of window content to stationary value) |
|
|
The values column is there, but has been sized away to almost nothing because WPF tries to measure the TreeViewItem content before the property grid is populated. Set the Width or MinWidth on the property grid:
and you should be good to go. Setting the ItemsSource in Window_Loaded should be fine. |
|
|
Thank you for reply. It really works, but in in some cases property name may be longer than 250 and the property values again are cut, and there is cases when 250 it's to much and there is so much unused space. So I need a more flexible solution of this issue. Are there any ideas how to do this depends PropertyGrid content size? |
|
|
You could bind the Width to the ActualWidth of the containing TreeViewItem:
The wrinkle with this is that it can lead to scroll bars getting cut off if the tree view is itself having to scroll. You should be able to compensate for this using a simple converter on the binding. |
|