This project has moved. For the latest updates, please go here.

PropertyGrid not displaying CheckBox List for enum dropdown.

Aug 1, 2012 at 2:28 PM

Hello,

I have created propertygrid controls. And I am binding enum flags values to propertyGrid. By default its showing me combobox for enum, but i wanted to show checkBoxList. 

Here I am trying to accomplish this with this xaml.

<DataTemplate x:Key="TradingControlTemplateForToday" DataType="x:Type risk:TradingControl">
        <Border BorderBrush="Black" BorderThickness="2" Width="256" Margin="4">
            <StackPanel>
                <extToolkit:PropertyGrid Margin="2" SelectedObject="{Binding Path=Levels}" 
                                         ShowAdvancedOptions="False" ShowSearchBox="False" ShowSortOptions="False" />
                <extToolkit:PropertyGrid Margin="2" SelectedObject="{Binding Path=Limits}" 
                                         ShowAdvancedOptions="False" ShowSearchBox="False" ShowSortOptions="False" diag:PresentationTraceSources.TraceLevel="High" Background="AliceBlue">
                    <extToolkit:PropertyGrid.EditorDefinitions>
                        <extToolkit:EditorDefinition TargetType="{x:Type HorizontalAlignment}" >
                            
                            <!--<extToolkit:EditorDefinition.PropertiesDefinitions>-->
                            <!-- properties treated as bitmasks go here -->
                            <!--<extToolkit:PropertyDefinition Name="Max" />
                                <extToolkit:PropertyDefinition Name="GrossValueCalcFlags"/>
                                <extToolkit:PropertyDefinition Name="BlockListTypes"/>
                            </extToolkit:EditorDefinition.PropertiesDefinitions>-->
                            <extToolkit:EditorDefinition.EditorTemplate>
                                <DataTemplate>
                                    <TextBox Background="Red"/>
                                    <!--ui:CheckedListBox Items="{Binding Value}" /-->
                                </DataTemplate>
                            </extToolkit:EditorDefinition.EditorTemplate>
                        </extToolkit:EditorDefinition>
                    </extToolkit:PropertyGrid.EditorDefinitions>
                </extToolkit:PropertyGrid>
            </StackPanel>
        </Border>
    </DataTemplate>

Where you can see I am following code examples and trying to do simple test by putting red textbox before replacing with checkbox.

 

I am not getting any warnings also could anybody please help me.

 

thanks in advance.

 

-Kunjan

Jan 26, 2013 at 8:47 AM

Just the same as me. I have an flagged enum. I want to be able to set individual values.

No dice.

Feb 2, 2013 at 8:21 PM
I finally got it! It's an especial editor that I coded. If you need it, mail me at superjmn at live.com :)