Page 1 of 1

StiPanel CanGrow Does Not Grow With Internal StiText Elements

Posted: Thu Apr 15, 2021 12:56 am
by billy.goforth
I have the below code (C#) and am rending out a word wrapped StiText element INSIDE a StiPanel (Mine is inherited in custom class). Both have CanGrow set to true, yet the Panel will not grow and show all of the text when it is taller than the Panel.

What Am I Missing?

IMAGE ATTACHED TO SHOW DISPLAY FAIL. THERE ARE ACTUALL SIX ITEMS IN ARRAY
CAN_GROW_FAIL.jpg
CAN_GROW_FAIL.jpg (12.41 KiB) Viewed 1486 times


*** CODE ***
if(param != null)
{
var searchPanel = new StiPanel();
searchPanel.CanShrink = true;
searchPanel.Top = headerText.Bottom;


var tile = new ContentDisplayTile(); //-- CUSTOM PANEL
tile.CanGrow = true; //-- SET CAN GROW
tile.CanShrink = true;
tile.Name = "Tile " + count.ToString();
//tile.Width = .5;
tile.Height = .6;


var keyText = new StiText(new RectangleD(.05, .01, .9, .15));
keyText.CanGrow = true; //-- CAN GROW HERE
keyText.CanShrink = true;
keyText.TextBrush = new StiSolidBrush(Color.Gray);
keyText.Name = param.Key;
keyText.Text.Value = param.Key + ":";
keyText.ShrinkFontToFit = true;
keyText.Font = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Regular);
keyText.GrowToHeight = true;

var valueText = new StiText(new RectangleD(.05, .16, .9, .15));
keyText.CanGrow = true; //-- CAN GROW HERE
keyText.CanShrink = true;
valueText.TextBrush = new StiSolidBrush(Color.Gray);
valueText.Name = param.Value.ToString();
valueText.Text.Value = param.Value.ToString();
valueText.ComponentStyle = "Bold";
valueText.UseParentStyles = false;
valueText.WordWrap = true;
valueText.Font = new Font(FontFamily.GenericSansSerif, 5, FontStyle.Bold);
valueText.GrowToHeight = true;

tile.Width = valueText.Width + .1;
tile.Components.Add(keyText);
tile.Components.Add(valueText);


searchPanel.Components.Add(tile);

header.Components.Add(searchPanel);
}

Re: StiPanel CanGrow Does Not Grow With Internal StiText Elements

Posted: Thu Apr 15, 2021 8:58 am
by Lech Kulikowski
Hello,

Please send us a sample that reproduces the issue for analysis.

Thank you.

Re: StiPanel CanGrow Does Not Grow With Internal StiText Elements

Posted: Thu Apr 15, 2021 12:19 pm
by billy.goforth
The report is build 100% dynamically in c#. This is the exact code that is building the display tile with the overflow even with the CanGrow property set to true. You can see in the code where it is set, where the text is added etc. What else do you need? We do not have an actual .mrt for this report.

Re: StiPanel CanGrow Does Not Grow With Internal StiText Elements

Posted: Fri Apr 16, 2021 7:56 pm
by Lech Kulikowski
Hello,

We couldn't reproduce the issue on our sample.
Please send us a sample that reproduces the issue for analysis.

Thank you.