我正在使用以下代码在gridview中绑定一个组合框列
DataGridViewComboBoxCell dgBatch = (DataGridViewComboBoxCell)grvProduct.Rows[pRowIndex].Cells[pComboColName];
DataTable dtBatch = new DataTable();
dtBatch = iExportSalesOrder.SelectProductDetails(pack_detl_ID);
dgBatch.DataSource = dtBatch;
dgBatch.ValueMember = "qty";
dgBatch.DisplayMember = "sBatch_No";我想在这个组合框中设置一个基于某个值的particular item as selected。如何设置selectedvalue in DataGridViewComboBoxCell。?
发布于 2011-08-17 20:05:20
设置dgBatch.Value = "selectedValue"它应该可以工作。
发布于 2011-08-17 20:10:52
dgBatch[Column.Name, Row.Name].Value = value;https://stackoverflow.com/questions/7092424
复制相似问题