【发布时间】:2024-01-23 14:14:01
【问题描述】:
我有一个包含 2 列的 DataGridView,第一个是组合框,第二个也是 windows 应用程序中的组合框。
如果用户更改了组合框,我需要适当地更新第三列中的第二个组合框,但我的问题是如何做到这一点? 我使用以下技术添加了两个组合框
DataTable Pdt = new DataTable();
Pdt = objProductCategory.SelectAll();
BindingSource ps = new BindingSource();
ps.DataSource = Pdt;
DataGridViewComboBoxColumn ProductCatColumn = new DataGridViewComboBoxColumn();
ProductCatColumn.DataSource = ps;
ProductCatColumn.HeaderText = "Product Category";
ProductCatColumn.Name = "ProductCatColumn";
ProductCatColumn.ValueMember = "ProductCatId";
ProductCatColumn.DisplayMember = "CatName";
gvSale.Columns.Add(ProductCatColumn);
【问题讨论】:
标签: c# datagridview desktop-application