Link to home
Start Free TrialLog in
Avatar of boardtc
boardtcFlag for Ireland

asked on

Setting TSringGrid.RowCount dynamically

I build a TStringGrid at run-time. Is it okay to reset the RowCount in a loop that adds the rows or should I initialize it to some large number and then reset it when I am finished adding rows? Also, I have to reset the FixedRows property within the loop where the RowCount is being set otherwise, the row is no longer fixed, why is this?

Thanks, Tom.
Avatar of rwilson032697
rwilson032697

If you know the number of rows you will add it is more efficient to set the rowcount once. The difference isn't huge though. Otherwise I just increment RowCount as I go.

As for the fixed rows, if the rowcount property is set to the same number of rows as the fixed rows, then the fixed rows no longer become fixed. Personally I think this is a bug in the grid control, but thats the way it is.

Cheers,

Raymond.
Avatar of boardtc

ASKER

Perfect, that's all clear now. Thank you, please answer to grade. Tom.
ASKER CERTIFIED SOLUTION
Avatar of rwilson032697
rwilson032697

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial