Retaining column widths in the datagridview (.net 2.0) :-(

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
S

Simon Harvey

Hi all,

Can anyone tell me if there is an easy way to retain per-user column
widths for the datagridview in a windows forms application.

I know I could do it with a lot of database programming and what not,
but I was hoping there would be a much easier solution. It seems like
such an obvious requirement, but I can find any articles on how to do it.

Many thanks to anyone who can advise

Kindest Regards

Simon
 
Have you considered making a dataset and storing the values in there (along
the lines of 1 table with 3 columns [tablename, columnname, width] and just
adding the values through a loop) then saving the xml in the users
application data folder.

Then when the application starts, load the xml file if it exists and restore
the changes.
 
Hi Andrew

Thanks very much for your thoughts. If there isn't an easier way I may
have to do just that - but I'm holding out for something simpler! :-)

I'm just hoping, perhaps in vain, that there is some dead easy way to
get this to work using some Visual Studio design time trickery.

Anyone?

Thanks again

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top