1 DataGridViewRow gridRow = dgvProducts.CurrentRow;
2 DataRowView rowView = (DataRowView)gridRow.DataBoundItem;
3 ProductData.ProductRow sourceRow = (ProductData.ProductRow)rowView.Row;
2 DataRowView rowView = (DataRowView)gridRow.DataBoundItem;
3 ProductData.ProductRow sourceRow = (ProductData.ProductRow)rowView.Row;
注:dgvProducts是用来显示数据的DataGridView,ProductData是自定义的数据集。