Yes, in the repeater properties, ensure the “Fit to Content in HTML” checkbox is selected. Then, in your dynamic panel properties, ensure the “Fit to Content” checkbox is selected. In the OnClick event, change the state of your dynamic panel and the row height should change automatically to the height of the content in the current state.
With your original question it sounds like you’re thinking of representing children–or more exactly the number of children–as dynamic panel states. Seems like that could work, with reasonable limitation of how many children can be added. Or, are you thinking that one state is for Parent and second state is for Child, with different heights for each? That would certainly be possible and probably quite efficient. In addition to your content column, include a “level” or “relationship” column to track whether an item is a parent or child. Your “Add another child item” button would trigger an Add Row action with the name of the child and set it’s “level” value to “child”. The OnItemLoad event would change the state of your dynamic panel based on the value in the “level” column, thus controlling the height of the row. Likewise for adding a parent, just set the “level” column value to “parent”.
That might be a little harder to achieve, but maybe you could also have a column to control the sort order of the repeater rows. Clicking the “add another” row could update its own “sorted” column value in addition to adding a new row, such that it would be moved to the bottom-most slot within its level.
OK… This was kind of fun to try out. See this demo file which has varying heights for parent and child rows and allows adding and removing rows with the requirement that the “add item” rows always appear at the bottom of their corresponding level. Is this what you were after?
Repeater Size and Hierarchy with Add Item.rp (99.0 KB)