Solved

TStringGrid

Posted on 2001-08-23
5
168 Views
Last Modified: 2010-04-06
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?
0
Comment
Question by:ntony
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6416721
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 ;-)
0
 
LVL 1

Author Comment

by:ntony
ID: 6416747
error
StringGrid.Columns[i]   // undeclared identifier 'columns'
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 6416772
as said typos possible
(because i have no delphi on hand)
try
cols
instead

meikl ;-)
0
 
LVL 1

Author Comment

by:ntony
ID: 6416796
tanks it's working
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6416806
glad to helped you :-)
good luck again

meikl ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now