FrancescoDS
FrancescoDS

Reputation: 995

custom editor for list of objects in xctk:PropertyGrid

In my WPF project, I'm using a PropertyGrid (from WPF Extended Toolkit) to manage some properties. In particular, I have a list of objects to be managed. By default, PropertyGrid allows user to manage list with a CollectionEditor, in which user can do CRUD operations, but I need a custom editor that allows only to edit objects, without creation or deletion. The only samples found are those present here but they seems to explain only how to define a custom editor and change background of a field in grid.

How can I define a brand new custom editor for editing a list of objects?

Upvotes: 0

Views: 799

Answers (1)

NoNameStackExchange
NoNameStackExchange

Reputation: 404

Did you try something like:

<xctk:PropertyGrid.EditorDefinitions>
    <xctk:EditorTemplateDefinition TargetProperties="MyProperty">
        <xctk:EditorTemplateDefinition.EditingTemplate>
            <DataTemplate>
            ...
            </DataTemplate>
  </xctk:EditorTemplateDefinition.EditingTemplate>
</xctk:PropertyGrid.EditorDefinitions>

From there you can create your own control with a button that pop your editor.

Upvotes: 2

Related Questions