Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

Creating a line in a stringrid

I am using a stringrid to display a list of names etc and would like to insert lines at certain points in the stringgrid to separate the data. Can I do this? If so how?

Many thanks in advance

Ps: You do a great job - this is very helpful for someone like me
  • 3
2 Solutions
Eddie ShipmanAll-around developerCommented:
Set the rowheight of the row between irows to 2 and you'll see a difference.

You could add a new row at the end of your StringGrid and then shift all the values that are under the position you want to highlight.
Or you could paint them in different colours the sections that you need to be differentiated using the event OnDrawCell
Of course I suggest that you would use a component better than standard TStringGrid, it is called KStringGrid. It is an enhanced StringGrid that allows you to set titles in the middle of the rows to separate groups of data, and many more, such as rowcoloring and a lot more. Try it, it's free and the best for your purpose.
You can download it from here:
and you need to install this first:

After you install both packages you will get the StringGrid that will let you do more stuff like:
"extra features like columns, sorting, quick search, multiline cell values, custom cell editors, advanced drawing capabilities, etc"

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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