Expand everything but one

Grids for WPF Forum

Posted 5 years ago by Antoine Picard
Version: 18.1.0673
Platform: .NET 4.7
Environment: Windows 10 (64-bit)

Hi !

I want to expand all of my properties but one. I tried this DataFactory code according to your sample but it doesn't work :

protected override IPropertyModel CreatePropertyModel(object target, PropertyDescriptor propertyDescriptor, IDataFactoryRequest request)
 var propertyModel = base.CreatePropertyModel(target, propertyDescriptor, request);
 propertyModel.IsExpanded = propertyDescriptor.PropertyType.Name != "PropertyPatcher";
 return propertyModel;

 It correctly set isExpanded to true for everything but "PropertyPatcher", I checked in debug mode, but nothing is expanded anyway.

I also tried to set the ArePropertiesAutoExpanded to true in addition with that code but everything is correclty expanded even the one I don't want.

Any idea how I can achieve this ?

Comments (2)

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

Hi Antoine,

If you have the ArePropertiesAutoExpanded property set to true, it occurs after all the CreatePropertyModel calls and will set all propertyModel.IsExpanded properties to true.  So if you are doing any kind of selective expansion, then you want to keep ArePropertiesAutoExpanded as false.  That way, it should be using whatever IsExpanded setting you made in CreatePropertyModel.

I tested selective property expansion in our Property Expandability QuickStart and it worked fine.

Actipro Software Support

Posted 5 years ago by Antoine Picard


Thanks ! In fact, something I did was messing up after the CreatePropertyModel function.

My bad !

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

Add Comment

Please log in to a validated account to post comments.