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
Printable View
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
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
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
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?
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
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.
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