DataGridView Column Width

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Sm9obg==?=

    DataGridView Column Width

    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.
  • Marc Gravell

    #2
    Re: DataGridView Column Width

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

    {blah}.AutoSize Mode = DataGridViewAut oSizeColumnMode .AllCells;

    Marc

    Comment

    Working...