我尝试在gridview中添加组合框但是我收到此错误:
异常:类型的值 'System.Windows.Forms.DataGridViewComboBoxColumn'无法转换 到'System.Web.UI.WebControls.DataControlField'。
这是我的代码:
Dim bsCountry As BindingSource
Dim col As New DataGridViewComboBoxColumn
col.DataPropertyName = "countryName"
col.HeaderText = "Country"
col.Name = "cName"
col.DataSource = bsCountry
col.DisplayMember = "countryName"
col.ValueMember = "countryId"
GridView2.Columns.Add(col)
GridView2.DataBind()