How To: Change ColumnWidth AT runtime on DataGridView in VB.net 2005

  • Thread starter Thread starter Eric Fortin
  • Start date Start date
E

Eric Fortin

I have a DataGridView that I bind to a dataset at runtime (I do not set up
the data grid view for binding to that specific dataset at design time) and
I want to save the manually resized column widths so that next time the user
uses the screen, I can reset the width to what they manually made the last
time they were in the screen. The problem is that no matter what I do, the
width always returns to the original width of the column. I can
programmatically set to, say 330, but it's always reset (and shown) as 100.
I cannot figure out how to make the width of each column unique at runtime.

Any help with this problem?

Thanks
 
What is the AutoSizeMode property of your columns set to? Have you
tried setting that property to None?
 

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