DataGridView Column Width

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi,

I need to make the last column of my datagridview wide enough to contain a
long string, and I can use the horizontal scrollbar to see all of the data.

How can I do this? Currently the scrollbar does not show up. I wish that I
can make the column fit the data automatically.

Thanks.
 
On a column-by-column basis you can set the auto-size mode - for example:

{blah}.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;

Marc
 

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