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?
 
Back
Top