我有一个数据表。
货币 ID | 货币
0 | 美元
1 | 铢
2 | 欧元
5 | 卢比
6 | 日元
我已将此表绑定到 DataGridViewCombobox 单元格。用户可以选择一种货币一次。如果用户在第一个 DataGridViewRow 中选择“USD”,则下一行的组合框将没有“USD”。我能得到它吗?我试过这个。
private void setCellComboBoxItems(DataGridView dataGrid, int rowIndex, int colIndex, DataTable itemsToAdd)
{
DataGridViewComboBoxCell currencycell = (DataGridViewComboBoxCell)dataGrid.Rows[rowIndex].Cells[colIndex];
currencycell.DataSource = dtCurrency;
currencycell.ValueMember = "CurrencyId";
currencycell.DisplayMember = "CurrencyShortName";
}
我无法修改 DataSource 属性。我怎么才能得到它?谢谢。