Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: Property Grid: Displaying enums in combobox

$
0
0
Hi!

In our propertygrid, I'm currently utilizing the default behavior of displaying an enumeration as a combobox in our default style. But, when I add an editortemplatedefinition, such as this:

<xctk:EditorTemplateDefinition >
<xctk:EditorTemplateDefinition.TargetProperties>
              <xctk:TargetPropertyType Type="{x:Type sys:Enum}" />
            </xctk:EditorTemplateDefinition.TargetProperties>
            <xctk:EditorTemplateDefinition.EditingTemplate>
              <DataTemplate>
                <ComboBox>
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <ComboBox ItemsSource="{Binding Value}" IsEditable="True"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
                </ComboBox>
              </DataTemplate>
            </xctk:EditorTemplateDefinition.EditingTemplate>
          </xctk:EditorTemplateDefinition>
A lot of things don't seem to work. Can you provide the default template you are using (for an enumeration) if a custom editor template definition isn't supplied?

Or, perhaps, you can answer my real question: I would like to have our combobox display enum strings that come from our resource file so that they can be translatable. I was looking to use a typeconverter, like this: http://stackoverflow.com/questions/796607/how-do-i-have-an-enum-bound-combobox-with-custom-string-formatting-for-enum-valu . Do you have any examples of the best way to do this?

Thanks!
   -Glenn  

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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