Sunday, October 19, 2008

Auto Fit Columns in a DataGridView

I have posted a function to auto-fit the columns in a ListView before. However, when I wanted to do the same thing for a DataGridView, the task is a little different (yet easier):


DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells

3 comments:

Note: Only a member of this blog may post a comment.