Re: Creating new settings on the fly
- From: "RobinS" <RobinS@xxxxxxxxxxxxxxx>
- Date: Mon, 29 Jan 2007 17:01:59 -0800
Well, you *could* define a table just for this purpose in the database and
add userid to the primary key, but that kind of seems like overkill.
I'd probably use the settings. I'm interested to see how you solve this,
because I also want to save the column widths of my grid columns.
Do you know how to create your own area in the settings and read/write to
it, so it has a key you can recognize (like CustomerGridColWidths)? I have
a code sample if you want one.
Robin S.
-------------------------------------------
<lord.zoltar@xxxxxxxxx> wrote in message
news:1170112376.119213.178520@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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?
.
- Follow-Ups:
- Re: Creating new settings on the fly
- From: lord . zoltar
- Re: Creating new settings on the fly
- References:
- Creating new settings on the fly
- From: lord . zoltar
- Creating new settings on the fly
- Prev by Date: Re: Working
- Next by Date: Re: I now understand Aaron Kempf (WAS: WHERE CAN I ASK A QUESTION ABOUT VB?)
- Previous by thread: Creating new settings on the fly
- Next by thread: Re: Creating new settings on the fly
- Index(es):
Relevant Pages
|