Skip to main content

Managing Collection Properties

  • 6 minutes to read

The Property Grid allows you to add, browse and edit collection properties.



The code sample below illustrates how to add a new objects to collections using CollectionDefinition.NewItemInitializer property. To use this code sample in your project, reference the DevExpresss.Xpf.Grid and DevExpress.Xpf.Grid.Core assembly.

The PropertyGrid control supports adding new objects to collections using the collection editor. To pre-set certain properties for a new object or create an object without the default constructor, use the CollectionDefinition.NewItemInitializer property. Like PropertyDefinitionBase.InstanceInitializer, it should be set to an object that implements the DevExpress.Mvvm.Native.IInstanceInitializer interface.

View Example

<Application x:Class="pgrid_collection.App"