• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

rearrange fields in a paradox 7 table

I have a paradox table drv.db that is displayed using a twwdbgrid in delphi 4.  The client wants a field that is at the bottom of the table, that displays at the far right in the grid, moved to now be the third field in the order.  I tried using database desktop to do this and works fine on my machine, but when I compile and release to the user it still puts it at the end.  Any ideas on how I could solve my issue, thanks.
0
farminsure
Asked:
farminsure
  • 3
  • 3
  • 2
1 Solution
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
You can simply change the order of the twwdbgrid columns.
I guess that right now you're simply displaying the fields directly into the grid.
If you use the column editor you can customize the order of the columns and also other features
0
 
farminsureAuthor Commented:
that sounds great.  is the column editor in the properties of the grid in the object inspector?
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
Yes. Or you can use the context menu right clicking on the grid in design time
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
farminsureAuthor Commented:
i right clicked do not see the context menu and do not see this editor in the obj inspector Ferruccio68?  I attached a screen shot..this is delphi 4
column.jpg
0
 
Ferruccio AccalaiSenior developer, analyst and customer assistance Commented:
Sorry, I see now. I forgot It's TWWDBGrid

Well, step by step

1)You have a TTable (or TAdoTable) on your form
2)You have a TDatasource linked to the Table
3)You have your TWWDbGrid linked to the TDatasource

Now open the table
Once the table is open double click on the TwwDBGrid.
You'll have the columns editor with capability of drag them in different order, customize their width and title and other things
0
 
Ephraim WangoyaCommented:

Looks like you are doing a select * from the table and you end up with the exact order of the fields as in the database.

One way is to use the actual field names in your select statement select field3, field10, field9, etc
Not a good method

You also have to consider the next time the client wants the tenth field to be displayed in position 6.

A good way to handle this would be to save the configuration either in some ini or xml file or even in a database table
Then let the user be able to drag the columns wherever they wish and you save the positions. Next time the client opens the form, just read in the correct positions and reconfigure your grid accordingly. Now with this method, you dont have to build a new version every time the client decides to change field positions
0
 
farminsureAuthor Commented:
Thank you Ferruccio68, I didn't even know that feature was available.  This worked!
0
 
Ephraim WangoyaCommented:

Do think of what I said about the custom configuration as well.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now