How to avoid gridpanel last row take higher than others? I have 10 rows with 10 percent value
If I append a new row with 0 percent the prior row which tend to be the last row take the right height but a new row borders appears at the bottom which I don't desire


When
SizeStyle=ssPercentthe size calculation includes adoublevalue (the percentage). InVCLthe result must be rounded to a whole number (= pixels). The code usesTrunc(), presumably to assure that the number of rows fit into theGridPanel. Then, the excess pixels (if any) are "given" to the last row.Instead of
SizeStyle=ssPercentyou can useSizeStyle=ssAbsoluteand define the row heights as number of pixels. In this case the calculation does not include float values and there's no need for rounding. In this case you can declare the height of each row e.g. 28 an if the height ofGridPanel1is 280, then all rows are of equal height.You can select
SizeStylein the IDE (Object Inspector) by selecting allTRowItemin the structure pane underRowCollection.You can define these settings also at runtime.
Edit after comment
If you use
SizeStyle=ssPercent, you need to make a choise between the two cases you show in your question.If you use
SizeStyle=ssAbsolute, you can use theTGridPanel1.OnResize()event to recalculate the item heights:In addition, if the color of the
GridPanel1is the same as that of the form, you may want to set theGridPanel1.BevelOuter=bvNonewhich hides the border line of theGridPanel1and the empty space that appears beneath the rows (whentothis not evenly divisable) becomes unnoticeable.