-
January 16th, 2006, 05:10 PM
#1
Hiding a DataGridView column
I am successfully displaying a DataTable with two columns as the DataSource in a DataGridView. The second column contains an internal reference code which I need but would like to hide.
The method given by MSDN http://windowssdk.msdn.microsoft.com...b7c7e5be15.asp seems to exactly apply:
Code:
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = MyDataSet;
dataGridView1.Columns[MyColumnHeaderName].Visible = false;
However the MSDN method fails at the third line in VS2005 because Columns.Count == 0. Does anyone have a workaround for this bug?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|