Displaying Collection properties in property grid

Grids for WPF Forum

Posted 12 years ago by Rithesh
Version: 12.1.0562


    I am using the Actipro propertyGrid to display the properties of the comboBox (Similar to Visual Studio Designer). But I find at the Items property which is only the getter property is disabled. I cannot add the Items to the comboBox through property grid. I could create my own editor to add the Items but fact that it is disabled will not allow me to display the editor also.

    I have tried using both ways of loading the property grid.

1) by setting the propertyGrid.SelectedObject = mycomboBoxObject;

          In this case the Items property is disabled.

2) I have tried using the Datafactory and PropertyDescriptorDataAccessor to load only some of the properties which are required by me.

       In this case the Items property is not visible at all in property grid. And I guess this is because Items property of ComboBox has only Getter and No Setter.

Please let me know if there is any way I enable the Items property in propertyGrid? And also is there any way to expose the Items property when I use the DataFactory?  I would be interested in second question more since that is the way I will using the property Grid.

Thanks and regards,


Comments (1)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Rithesh,

List properties will show as read-only by default.  If you look at our Collection DIsplay Model QuickStart or the documentation on collections, you can see the various options available to you to change expandability, etc.  However in regards to editing, they will only allow you to edit generic list types.  Since ItemsCollection is a non-generic IList, and so it won't be editable by PropertyGrid.

You should be able to define any property for display via a custom factory.  It's hard to know what the problem you're having is though without a simple sample project to debug.

Actipro Software Support

The latest build of this product (v24.1.2) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.