Link to home
Start Free TrialLog in
Avatar of ntony
ntony

asked on

TStringGrid

i have a StringGrid and i want in runtime to delete a column! (or to move it to the end and then to do coulcount:=colcount-1 => deleted)
how can i do it?
Avatar of kretzschmar
kretzschmar
Flag of Germany image

for i := delIndex to stringgrid1.colcount -2 do
  stirngrid1.columns[i].assign(stirngrid1.columns[i+1]);
stringgrid1.colcount := stringgrid1.colcount-1;

delindex is the zerobased index of the column which is to delete

just from head (not tested, typos possible)

meikl ;-)
Avatar of ntony
ntony

ASKER

error
StringGrid.Columns[i]   // undeclared identifier 'columns'
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ntony

ASKER

tanks it's working
glad to helped you :-)
good luck again

meikl ;-)