Recent

Author Topic: StringGrid Question  (Read 4942 times)

tbonejo

  • Jr. Member
  • **
  • Posts: 66
StringGrid Question
« on: May 13, 2009, 03:07:40 pm »
I am using a StringGrid to display paths I am searching on a computer. In my function to show what path and file was found I am doing this:

Code: [Select]
StringGrid1.Cells[1,i] := Path + Rec.Name;
     StringGrid1.AutoSizeColumn(0);
     StringGrid1.RowCount := i + 1;
     Inc(i);                       

However as soon as I run this I get an exception that says:

Index out of range. Cell[Col=1 Row = 2090325504]

I cannot understand this because I set the rowcount to like 100,000 in the Property Editor to try and see if that was an issue but that did not work.

Any ideas?

Thanks,

Tom

Arminius

  • New Member
  • *
  • Posts: 39
Re: StringGrid Question
« Reply #1 on: May 13, 2009, 11:00:32 pm »
Tried to invert like StringGrid1.Cells[i,1] := Path + Rec.Name; ?

tbonejo

  • Jr. Member
  • **
  • Posts: 66
Re: StringGrid Question
« Reply #2 on: May 13, 2009, 11:36:30 pm »
I got it working now.

Not sure why but there is not a method for adding another row so if you increment by rowcount and add you strings to the cells for that row your ok.

 

TinyPortal © 2005-2018