The Cols property is an array of TStrings's. Roll through it, and delete the n'th element of each Col:
Code:
for i := 0 to mystringgrid.RowCount - 1 do
if mystringgrid.Cols[i].Count >= n then
mystringgrid.Cols[i].Delete(n);
TStrings's (or, as you'll declare 'em in your app, TStringList's) are very nifty and powerful. Look up TStringList in help. -- Doug Burbidge mailto:dougburbidge@yahoo.com
for i := n to StringGrid1.RowCount - 2 do
StringGrid1.Rows[i].CommaText := StringGrid1.Rows[i+1].CommaText;
StringGrid1.RowCount := StringGrid1.RowCount - 1;
CommaText is essentially the entire contents of the row. -- Doug Burbidge mailto:dougburbidge@yahoo.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.