Solved

Change order of DBGrid-columns (runtime!)

Posted on 1998-10-02
5
663 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
[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 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 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