|
-
Sep 24th, 2002, 01:02 PM
#1
Thread Starter
Fanatic Member
How to save the current settings from a DbGrid
Hi,
when the User of my program change for example the width of a column how can I safe this settings?
(I tried DefColWidth = 0 but it is not true what the MSDN say that it makes autosize.)
nice greetings
Franky
-
Sep 24th, 2002, 01:17 PM
#2
Hyperactive Member
i don't know about in a dbgrid but in a flexgrid typw this in the form load code.
databasename.colwidth(column number 0 is first) = a number
for example
database.colwidth(0) = 700
-
Sep 24th, 2002, 09:19 PM
#3
Thread Starter
Fanatic Member
Hi
I know this, but that is the problem.
I want that the user move with the mouse the column to the requested width and then when he leaves that it just save the position of the width.
Or how to autosize would be nice.
any ideas from anybody?
Franky
Last edited by Franky; Sep 24th, 2002 at 09:26 PM.
-
Sep 24th, 2002, 09:22 PM
#4
Fanatic Member
Why don't you write the settings to an ini or text file then load the settings when the program starts and set the grid?
-
Sep 24th, 2002, 09:28 PM
#5
Thread Starter
Fanatic Member
Hi Workhose
This would be possible, BUT the DbGrids are always different and they get created from the Enduser at runtime. There is no limitation ofDbGrids, so it is really a work to write that. I would be interested for a easier way. I don't understand why the autosize that Microsoft promise doesn't work ..........
nice greetings
Franky
-
Sep 24th, 2002, 09:40 PM
#6
Fanatic Member
I'm not sure about the AutoSize. Don't use DBgrid too much. But if you want to save user settings, then I think you'll have to...well, save the user settings somewhere. It's not endless. When the form/app closes, write the data source and loop the columns and write the widths. When the form/app opens, read the data and set the grid.
-
Sep 24th, 2002, 09:44 PM
#7
Thread Starter
Fanatic Member
It is unfortunatly a lot of work ...
Because as I said I (can) have many DBGrids. I use them only for Users who need to create them. But the columns are diffferent in every DBGrid. I could store for every DBGrid the column sizes of all columns in a field but that would be not the most elegant way.
nice greetings
Franky
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|