I have a DGV related to the binding source generation code here.
this.dgvDocumentList.AllowUserToAddRows = false;
this.dgvDocumentList.AllowUserToDeleteRows = false;
this.dgvDocumentList.AutoGenerateColumns = false;
this.dgvDocumentList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDocumentList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dMTitleDataGridViewTextBoxColumn,
this.urlCol,
this.idCol});
this.dgvDocumentList.DataSource = this.docListFetchBindingSource;
this.dgvDocumentList.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvDocumentList.Location = new System.Drawing.Point(3, 3);
this.dgvDocumentList.MultiSelect = false;
this.dgvDocumentList.Name = "dgvDocumentList";
this.dgvDocumentList.ReadOnly = true;
this.dgvDocumentList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvDocumentList.Size = new System.Drawing.Size(336, 493);
this.dgvDocumentList.TabIndex = 0;
this.dgvDocumentList.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDocumentList_CellContentDoubleClick);
this.dgvDocumentList.SelectionChanged += new System.EventHandler(this.dgvDocumentList_SelectionChanged);
The column code is listed here.
// dCBModLinkDataGridViewTextBoxColumn
//
this.dCBModLinkDataGridViewTextBoxColumn.DataPropertyName = "DCBModLink";
this.dCBModLinkDataGridViewTextBoxColumn.HeaderText = "DCBModLink";
this.dCBModLinkDataGridViewTextBoxColumn.Name = "dCBModLinkDataGridViewTextBoxColumn";
this.dCBModLinkDataGridViewTextBoxColumn.ReadOnly = true;
this.dCBModLinkDataGridViewTextBoxColumn.Visible = false;
//
// dCBIDDataGridViewTextBoxColumn
//
this.dCBIDDataGridViewTextBoxColumn.DataPropertyName = "DCBID";
this.dCBIDDataGridViewTextBoxColumn.HeaderText = "DCBID";
this.dCBIDDataGridViewTextBoxColumn.Name = "dCBIDDataGridViewTextBoxColumn";
this.dCBIDDataGridViewTextBoxColumn.ReadOnly = true;
this.dCBIDDataGridViewTextBoxColumn.Visible = false;
//
// eQModModelNumberDataGridViewTextBoxColumn
//
this.eQModModelNumberDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this.eQModModelNumberDataGridViewTextBoxColumn.DataPropertyName = "EQModModelNumber";
this.eQModModelNumberDataGridViewTextBoxColumn.HeaderText = "Model Number";
this.eQModModelNumberDataGridViewTextBoxColumn.Name = "eQModModelNumberDataGridViewTextBoxCol
As you can see, the column definition for dcbModLinkDataGridViewTextBoxColumn says visble = false; He also talks about this in the property table. It is still displayed in the application at startup.
If I change the entries of the columns in the list, I get the following results. No change except the order they appear in the column list.
DCBID (visible) - DCBModLink (invisible) - EQModModelNumber (visible)
DCBModLink (Visble) - DCBID (Invisible) - EQModModelNumber (Visible)
EQModModelNumber (Visible) - EQModModelNumber (Invisible) - DCBID (Invisible)
, , , , DGV . DGV , , .
: datagridview, datagridview id , .
. .