newbie question on synchronization

Grids for WPF Forum

Posted 9 years ago by jack kenyon
Avatar
Hi,
I have a combo box linked to a ObjectDataSource with ObservableCollection<>.
I want the property box to work with the current object that is selected by the combo box.

I have the following setup.

<ObjectDataProvider
x:Key="dbListResources"
ObjectType="{x:Type bizobj:DataServerCollection}"
MethodName="GetCollection">
</ObjectDataProvider>
.....
<Grid
DataContext="{Binding Source={StaticResource dbListResources}}">
.......

<ComboBox
Name="comboBox1"
ItemsSource="{Binding}"
IsSynchronizedWithCurrentItem="true"
SelectedValuePath="Shortcut"
ItemTemplate="{DynamicResource dbListLayout}">
</ComboBox>
.......
<propgrid:PropertyGrid
Margin="21,96,21,27"
Name="propertyGrid1"
CollectionDisplayMode="Expandable"
IsItemsSourceAutoUpdated="True"
SelectedObjects="{Binding}">
</propgrid:PropertyGrid>
....
</Grid>

The combo box works as expected, but the property editor shows the correct property names, but the data seems unvarying and incorrect.

Can you show me what I am doing wrong please?

Comments (2)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jack,

You are binding the PropertyGrid to the list of items, not the "selected" item. You would need to use SelectedObject="{Binding SelectedItem, ElementName=comboBox1}" to only display the item selected by the ComboBox.


Actipro Software Support

Posted 9 years ago by jack kenyon
Avatar
Thankyou
The latest build of this product (v2019.1 build 0681) was released 9 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.