Problem

Expand everything but one

Posted 12 days ago by Avatar Antoine Picard

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)

Posted 12 days 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 10 days ago by Antoine Picard

Hi,

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

My bad !

Information The latest build of this product (2018.1 build 0674) was released 4 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.