Re: Creating new settings on the fly

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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?



.



Relevant Pages

  • Re: Violation of primary key
    ... to have deleted but I cannot find the one that is trunkating my database. ... tried sorting by primary key but I dont' see any doops. ... I checked the settings but nothing seems ...
    (microsoft.public.sqlserver.server)
  • Re: What does everyone else do for graphically displaying data?
    ... I like to work with a PostgreSQL database hookup, and just build and tear down ... tables in parallel with the application programming. ... examples and it ~appears things are managed by sync'ing a primary key ... in all the objects needed to display data. ...
    (comp.lang.java.databases)
  • Re: Violation of primary key
    ... You can prove this with a query like: ... primary key values of the data you are trying to insert and either skip the ... > to have deleted but I cannot find the one that is trunkating my database. ... I checked the settings but nothing seems ...
    (microsoft.public.sqlserver.server)
  • Re: Reinstall Microsoft Jet 4.0
    ... settings and/or connection string settings rather than Jet being corrupted. ... Making sure your table has a primary key field may also help solve the problem. ... Aside from giving Access better performance, a lack of a Primary Key seems to cause issues in a number of database formats. ...
    (borland.public.delphi.database.ado)
  • Re: Determining text width & truncating
    ... create a Word document that shows all of the database. ... i got rid of tables and instead set up tab ... settings and background colors, so the end result looks like a table, ... width of the current tab space it needs to fit into, ...
    (microsoft.public.word.vba.general)