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 got data that I would like to display in a property grid. The issue is that the data is in rows, not columns and are not predefined. The values come from a table. It looks like most of the property grid implementations I see would probably not support this. Can the MindScape Property Grid work this way? Sample Data: Id,Grouping,Setting,Value 1,Appearance,Title,Blue 2,Appearance,Content,Red 3,Layout,Orientation,Horizontal 3,Layout,Margin,10
|
|
|
No, the property grid only supports key-value pairs. We do however support hierarchy so you could get something like this: + Id 1 The categories could be displayed as additional hierarchy levels or (if the categories were the top-level items) as groups. We also support some tricks that would allow you to include the Id and Category information in the "key" e.g. 1 [Appearance] Title Blue These tricks support full WPF templating of the "key" area so you could format these to line up, use icons, use colour, or however you want to blend the 'key' data. However, your users would not be able to edit the 'key' data (hmm... well, they might, but it would be a bit weird), only the 'value' member. If this is what you need then let me know and I'll post some pointers. Otherwise, what you're looking for sounds more like a data grid than a property grid. And by happy coincidence, we're beta-ing one at the moment: http://www.mindscapehq.com/blog/index.php/2011/09/14/wpf-elements-5-beta-grab-it-and-enter-the-xbox-draw/ |
|
|
So, the property grid does what I would like. I'm having an issue, though. 1) Being new to WPF, I'm having trouble implementing the custom grouping I've seen talked about using MVVM. When I create a CollectionViewSource or ICollectionView and bind the property grid to it, the grid does not refresh with data when I update the underlying dictionary and call the property changed event. Thoughts?
XAML:
<ms:PropertyGrid Name="PropertyGridWithDefaultEditors" ItemsSource="{Binding Path=Items}" AllowModifyCollections="False" IsToolBarVisible="True" />
ViewModel:
private CollectionViewSource _items; public CollectionViewSource Items { get { return _items; } set { _items = value; OnPropertyChanged("Items"); } }
Then setting the property: Items = new CollectionViewSource { Source = myPropertyList };
|
|
|
Implement INotifyCollectionChanged on the collection. (The ObservableDictionary class, included with WPF Elements, does this for you.) |
|