PropertyGrid automatically select first non category by default

Grids for WPF Forum

Posted 2 months ago by GuillaumeGC
Version: 19.1.5
Avatar

When I select an object for the first time, the actipro PropertyGrid seem to select the first item that is not a category.

Is it possible to avoid this? Because It is a problem in my case since I show a UI based on the property selected.

Thanks!

Comments (3)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I'm sorry but it appears the logic to select the first IPropertyModel or ICategoryEditorModel after a refresh is built-in.  If your UI is coming from a data model that doesn't implement one of those, it would likely be skipped over.  Perhaps you could try to have your data model for this UI not implement those two interfaces?


Actipro Software Support

Posted 2 months ago by GuillaumeGC
Avatar

I am using a factory and the GetPropertyModels specifically returns IList<IPropertyModel>, I don't think I have a choice to use IPropertyModel and ICategoryModel, or am I missing an alternative?

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The DataFactoryBase.GetPropertyModels method is called by the DataFactoryBase.GetDataModels method.  Then the returned properties are categorized and ICategoryModels are added as needed.  You could override GetDataModels to inject a model that implements the base IDataModel instead of IPropertyModel, since that method's result expects a list of IDataModel objects.


Actipro Software Support

The latest build of this product (v25.1.0) was released 26 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.