I'm trying to get the display form (see image) to auto-size, based on the data cards in the form, but there does not seem to be auto height option for combo boxes inside a card, where multiple items are listed. I'm a little confused why some items have an auto-height feature and others don't. How can I get the combo boxes to size to the data, so the card (which is set to DataCardValue2.Height+10) will size correctly.
Separately, but related, any way to have these display as a bulleted list that auto-sizes?
Hi @dsgnmind :
You can dynamically set its height according to the length of the text to be displayed in this combo box.For example,set the combo box's Height property to:
(I assume that I need the text to be arranged in a line with 35 characters, and the height of each line is greater than 50)
RoundUp( Len( Concat(Self.SelectedItems,Value) /*Get the string to be displayed in the combobox*/ )/35 /*get the number of rows*/, 0 )*50
Thank you for your quick response @v-bofeng-msft
I understand the notion of the formula, but not the mechanics exactly. Can you please explain the 35, 0, and 50 values? I've been playing with the 35 and 50 values in an effort to dial the formula, but I am getting inconsistent results. For some records I get a larger than desired white space below, and for others records, where I expect the height to expand to two lines, it does not, resulting in vertically center-aligned text, and the "more..." text, or the scroll wheel. Even though the two data cards match in their properties (width, etc.), what works better on one, does not translate to the other, and I can only guess that is because of the exact length of the particular record. I tried to add a +10 to the end of the formula, but that vertically center-aligns the text when the value is "none".
Hi @dsgnmind :
I noticed that there are about 60 characters in one line in your screenshot, so you can change 35 to 60 to reduce the number of blank lines as much as possible.
RoundUp( Len( Concat(Self.SelectedItems,Value) /*Get the string to be displayed in the combobox*/ )/60 /*get the number of rows*/, 0 )*40
Thanks again @v-bofeng-msft. I've been tweaking and tweaking the values, but cannot seem to get a consistent enough behavior. I either get larger than desired gaps below the content, or it cuts off, and I get the "more..." or scroll bar. There doesn't seem to be a happy medium between. I do see how this formula works with content that is consistent (within a fixed or more limited range of characters). But, I have content where one record might have no content and another record with lines of content.
Any ideas on getting more consistent behavior across records with a large variation between the data that is pulled?
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.