private void ColumnToolStripMenuItem_Click(object sender, EventArgs e) { ColumnNamesForm l_ColumnNamesForm = new ColumnNamesForm(this); DataTable l_DataTable = this.dataGridView.DataSource as DataTable; for (int iIndex = 0; iIndex < l_DataTable.Columns.Count - 1; iIndex++) { l_ColumnNamesForm.listBox.Items.Add(this.dataGridView.Columns[iIndex + 1].HeaderText); } l_ColumnNamesForm.ShowDialog(this); }
private void ColumnToolStripMenuItem_Click( object sender, EventArgs e ) { ColumnNamesForm l_ColumnNamesForm = new ColumnNamesForm(this); DataTable l_DataTable = this.dataGridView.DataSource as DataTable; for ( int iIndex = 0; iIndex < l_DataTable.Columns.Count - 1; iIndex++ ) l_ColumnNamesForm.listBox.Items.Add( this.dataGridView.Columns[iIndex + 1].HeaderText ); l_ColumnNamesForm.ShowDialog( this ); }