megabyte214
Programmer
I have read that the easiest way to hide a datagrid column is to set its width to 0. I am working on a Windows App and have tried several ideas that I have found, but none seem to work. Any help is greatly appreciated.
Code:
//error: "Index was out of range. Must be non-negative and less than the size of the collection"
customerDataGrid.TableStyles[0].GridColumnStyles[0].Width = 0;
//error: "System.Windows.Forms.DataGrid' does not contain a definition for 'Columns"
customerDataGrid.Columns(0).Visible = False;