I'm doing this with some ootb functionalitys .... creating a dynamical SQL search for counting rows
Result = "Select Count(*) AS CountApp From TABLENAME"
with this number I have the quantity for the SubPartCollection
And then I have again a new dynamical SQL search to get the values and do the mapping.
Result = "Select * From ( Select ROW_NUMBER() OVER (Order By App_ID) As rownumber, COLUMNNAME, COLUMNNAME, COLUMNNAME, COLUMNNAME, COLUMNNAME From TABLENAME) As foo Where rownumber='" & Me.SubPartID & "'"
And I can use the grid on the Custom UI to show the result.
Does this help?
I have also done this with a subpart collection. I was really in search of a control that could display the results of a query without making a subpart collection. By making the subpart collection I crate approc 10000 part families that when I relase a model adds about 2 minutes to creating the release XML and sendingsaving the xml into the reproject database.
There are two things that I can think of.
First, use multi-combo bound to a db constraint. It won't show the grid 'til you click on the elipsis though.
Second, use Christian's suggestion, but add a before-release/before-save event handler to zero out those subpart quantities by forcing (.setinput) a zero onto the property that drives the quantity of that subpart collection, and an after-load/after-release event handler to revert that property to its calculated value. This would prevent the bloat of the save and/or release XML.
I suppose you could even use the process-step-change events instead of the save/release/open events in order to enable it only when you're on the process step that needs to display the view.
I tried using event on process steps to set the subpart collection quantity to 0 but that causes another performance hit when Rulestream deletes 6600 objects.