我正在使用代码
DataGridViewRow dViewRow = new DataGridViewRow();
DataGridViewTextBoxCell Sno = new DataGridViewTextBoxCell();
DataGridViewComboBoxCell dgCombo = new DataGridViewComboBoxCell();
dViewRow.Cells.Add(Sno);
dViewRow.Cells.Add(dgCombo);
dViewRow.Cells[0].Value = 1;
dViewRow.Cells[1].Value = "ASP";
然后我使用DataGridViewRow
DataGrid
绑定到主gridViewProducts.Rows.Add(dViewRow);
但是我收到以下错误:
System.ArgumentException:DatagridviewCombobox值无效
答案 0 :(得分:-1)
用户TemplateField
<asp:TemplateField HeaderText="List">
<ItemTemplate>
<asp:DropDownList ID="dlBox" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>