【发布时间】:2021-11-14 19:46:17
【问题描述】:
我已经有一个 DataTable (dt)。现在我想在表格末尾有一列,我可以在其中使用下拉菜单选择不同的数字。我只是找不到可以做到这一点的函数。
DataTable dt = new DataTable();// neuer DataTable dt wird erzeugt
foreach (IXLCell cell in row.Cells())
{
dt.Columns.Add(cell.Value.ToString());
}
if (dt.Columns.Count > 5) //prüfen ob Datum Kürzel und OK schon vorhanden sind
{
dt.Columns.Add(new DataColumn("CODE", typeof(string)));
// here i want to add the DropDown Menu Column
//Code is "ONE" or "TWO"
}
else //falss nicht --> hinzufügen
{
dt.Columns.Add(new DataColumn("OK", typeof(bool)));
dt.Columns.Add(new DataColumn("Datum", typeof(string)));
dt.Columns.Add(new DataColumn("Kürzel", typeof(string)));
}
【问题讨论】:
标签: c# windows forms windows-forms-designer