Programatically Set The Width of a column in a datagrid.

U

UJ

How can I set the width of a column in a datagrid? I'm creating a new table,
defining the columns then tying it to a datagrid and want to make the column
wider than the default (the default value is cutting off some of a string.)

TIA - Jeff.
 
G

Guest

Hi UJ,
if you want to have the columns auto adjust instead of setting them to a
fixed width then you can set the DataGridViews AutoSizeColumnsMode. The
columns will then autosize depending on the size of the data in them.

Hope that helps
Mark Dawson
http://www.markdawson.org
 

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

Top