Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: PropertyGrid Combobox Custom Editor

$
0
0
Hi there,

I'm trying to get a combo box to display a drop down list of items for a particular property (an enumeration), but everything I've tried results in an empty list.

The object property itself can't have any UI attributes associated with it (it's in a separate lib), so I'm trying to do everything in the xaml/c# code for the window displaying the property grid.

I've tried setting the item source of the combo box a number of different ways :
<xctk:EditorDefinition>
                        <xctk:EditorDefinition.PropertiesDefinitions>
                            <xctk:PropertyDefinition Name="BlendState" />
                        </xctk:EditorDefinition.PropertiesDefinitions>
                        <xctk:EditorDefinition.EditorTemplate>
                            <DataTemplate>
                                <ComboBox ItemsSource="{Binding Path=BlendOptions}" />
                            </DataTemplate>
                        </xctk:EditorDefinition.EditorTemplate>
                    </xctk:EditorDefinition>
Where BlendOptions has been an IItemSource instance, a List<string> instance etc belonging to the class with the property grid instance... but nothing I'm doing seems to work. I'm definitely populating the lists/item sources before the components for the window are initialized.

I've also tried using a dictionary, setting the DisplayMemberPath & SelectedValuePath, but I still get an empty combo box.

The funny thing is if I make a combo box outside of the editor definition (embed it in to the UI), the bindings seem to work.

Any ideas?

Viewing all articles
Browse latest Browse all 2157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>