2 Replies - 5279 Views - Last Post: 04 October 2012 - 10:40 AM Rate Topic: -----

#1 pendaz  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 75
  • Joined: 14-August 12

Resizing DataGridView to fit its contents

Posted 04 October 2012 - 10:32 AM

I can't seem to find what im looking for although i've searched around, i seem to find a lot of solutions to fit the datagridview to its form, but not the datagridview to its contents.


So basicall, i have a datagrid which displays data, the columns are set to autosize to fit the data, each user will fill different data into the columns therefore they will be different sizes resulting in a different sized datagrid each time


So how can i automatically resize the datagrid to fit its contents?



Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Resizing DataGridView to fit its contents

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: Resizing DataGridView to fit its contents

Posted 04 October 2012 - 10:35 AM

Have you set the AutoSizeColumnsMode and/or AutoSizeRowsMode accordingly?

You can also set the WrapMode in the .DefaultCellStyle
Was This Post Helpful? 0
  • +
  • -

#3 pendaz  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 75
  • Joined: 14-August 12

Re: Resizing DataGridView to fit its contents

Posted 04 October 2012 - 10:40 AM

aha, i worked it out:

autosizecolumsmode = fill gives required results


this was previously set to columsheader rather than fill



thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1