?
Solved

TStringGrid

Posted on 2001-08-23
5
Medium Priority
?
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 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