Showing posts with label datagridview. Show all posts
Showing posts with label datagridview. Show all posts

Thursday, November 11, 2010

DataGridView WordWrap

To get cell text to word wrap is easy once you know the combination of properties to set:

DataGridView > AutoSizeRowsMode = AllCells
DataGridView > Columns > *Your Column* > Default Cell Style > Wrap Mode = True
DataGridView > Columns > *Your Column* > AutoSizeMode = DisplayedCells

Friday, July 16, 2010

DataGridView Adds Extra Columns

The AutoGenerateColumns property is not available on the design surface of VS, only in code. What a pain. So, to prevent columns from displaying:

Public Sub New() '// or whatever
my_data_grid_view.AutogenerateColumns = False

End Sub