我应该如何动态地在selectedindexedchanged上添加datagrid列?
I assume the Combobox contains datagrid-columns (or Datatable columns) ?
You can simply set the Visible property to false, when you have found the column.
In WinForms:
Dim x as Integer = ...
dataGridView1.Columns[x].Visible = False
But please take a look at your question, it contains virtually no useful information.
In side the selection change event paste this coding
Datagridview1.columncount += 1
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.