[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

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.
0
boardtc
Asked:
boardtc
  • 2
1 Solution
 
rwilson032697Commented:
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.
0
 
boardtcAuthor Commented:
Perfect, that's all clear now. Thank you, please answer to grade. Tom.
0
 
rwilson032697Commented:
Ta!

Cheers,

Raymond.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now