AnsweredAssumed Answered

Databinding ComboBox to GraphicsCollection

Question asked by keithgemeinhart on Aug 8, 2013
Latest reply on Aug 9, 2013 by keithgemeinhart
Greetings,

I'd like to bind a GraphicsCollection (which is a property in a view model) to a combo box in a XAML window. The problem is I can't figure out how to display attribute values in the combo box. I can get it to display the Geometry property like this:
<ComboBox DataContext="{StaticResource MyViewModel}"                 DisplayMemberPath="Geometry"                 ItemsSource="{Binding CollectionOfGraphics}"  />


But I want to be able to do something like this that will display the OBJECTID or some other attribute:
<ComboBox DataContext="{StaticResource MyViewModel}"                 DisplayMemberPath="Attributes[&quot;OBJECTID&quot;]"                 ItemsSource="{Binding CollectionOfGraphics}"  />


I also tried this approach - unsuccessfully:

<ComboBox DataContext="{StaticResource MyViewModel}"                 DisplayMemberPath="Attributes[0]"                 ItemsSource="{Binding CollectionOfGraphics}"  />

Outcomes