L
lord.zoltar
I have a problem which I think can be solved by creating new Settings
on the fly, but I'mnot sure if it's possible, or if a better solution
may exists.
Here's the situation: I have a project with many different
dataGridViews to display data, and many of them have 10-20 columns
(the actual number of displayed columns is user/client controlled, and
in a couple cases could be ~30). The client would like to be able to
resize the columns manually. This is not a problem, I set the
AllowUserResizeColumn property of the grids to True. The problem is
that the columns don't remember their width when the application is
shut down and restarted. I'm not sure the best way to solve this:
My first thought was to create a setting in the My.Settings for each
column. The problem is, there are many MANY columns, and there is the
potential that new columns will be created by the user at run-time.
I'd like to create these settings automatically (at run time: check if
there is an existing setting and create it if not), but I don't know
if it's possible to do this.
My second thought was to create a special "column width manager"
object, and serialize it to the disc and then read it when the program
loads.
I also thought about storing all this column-width data in the
database, but the program is not multiuser and all users would share
the column widths (not an acceptable solution).
Has anyone else here ever had a similar problem? Or can anyone give a
recomendation?
on the fly, but I'mnot sure if it's possible, or if a better solution
may exists.
Here's the situation: I have a project with many different
dataGridViews to display data, and many of them have 10-20 columns
(the actual number of displayed columns is user/client controlled, and
in a couple cases could be ~30). The client would like to be able to
resize the columns manually. This is not a problem, I set the
AllowUserResizeColumn property of the grids to True. The problem is
that the columns don't remember their width when the application is
shut down and restarted. I'm not sure the best way to solve this:
My first thought was to create a setting in the My.Settings for each
column. The problem is, there are many MANY columns, and there is the
potential that new columns will be created by the user at run-time.
I'd like to create these settings automatically (at run time: check if
there is an existing setting and create it if not), but I don't know
if it's possible to do this.
My second thought was to create a special "column width manager"
object, and serialize it to the disc and then read it when the program
loads.
I also thought about storing all this column-width data in the
database, but the program is not multiuser and all users would share
the column widths (not an acceptable solution).
Has anyone else here ever had a similar problem? Or can anyone give a
recomendation?