Board index » delphi » How to clear StringGrid?

How to clear StringGrid?

Hi,
Is there a better (faster) way to clear a stringGrid cells other than clearing
each cell individually?
Many thanks,
cengiz

 

Re:How to clear StringGrid?


Quote
g...@Lehigh.EDU wrote:
>Hi,
>Is there a better (faster) way to clear a stringGrid cells other than clearing
>each cell individually?
>Many thanks,
>cengiz

You can clear it a column at a time, using something like:

  for i := 0 to Grid.ColCount - 1 do
     Grid.Cols[i].Clear;

If you have fewer rows than columns, it may be quicker to do rows
(same syntax) but I have not tested that.

Other Threads