Solved

Change order of DBGrid-columns (runtime!)

Posted on 1998-10-02
5
609 Views
Last Modified: 2010-04-06
Help...
I am developping a adress-database-application. I want to change the order (sequence) of the columns during runtime. How can I fix that ???
Thanx.
J.v.Barchum.
0
Comment
Question by:roosiedb
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1341539
Hi roosiedb,

what about this? : Table1.Field[4].index:=0 (this will move it to column 0 in the DBGrid)

Regards, Zif.
0
 

Author Comment

by:roosiedb
ID: 1341540
Sorry, that won't work (maybe because I am using Delphi 3.0 ???).
Please help me with this...
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 20 total points
ID: 1341541
Hi rooSiedb,

juSt tried it on my D3, and it SeemS to work, probably it haS to do with my miStype :-)). here iS the correct Source. Sorry for any inconvinianceS.

procedure TForm1.Button1Click(Sender: TObject);
begin
 Table1.Fields[4].index :=1
end;

RegardS, Zif.
0
 

Author Comment

by:roosiedb
ID: 1341542
Sorry, your answer really did not work. That was because you forgot the S in fieldS...

DBGrid1.Fields[0].Index := 2;

And I did not see the difference myself. When I copied and pasted your answer into my Delphi-application, it did not work at all. That's why I rejected your answer.
Now that you've found the error in your answer, I have fixed my problem.
Next time: watch your spelling please... I am a beginning Delphi-programmer and I don't know how to spell all these Delphi-terms myself yet, because I did not use this one before... Anyway, thank you very much for helping. I will increase and grade the answer now. Bye. J.v.Barchum.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1341543
no problem...  I'll try to do my best with the syntaxes. But after all E-E is intended to communicate with each other. So, these errors aren't a world-crime... except the time you lose with it... thanks! c.u. ZiF.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 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