如何选择网格(gridCustomer)中的每一行,第二个网格(gridOrder)按我的顺序显示对象信息?
我将选择网格 (gridCustomer) 的第一行,但网格 (gridOrder) 不会显示任何内容。
private void gridCustomer_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
//var s = gridCustomer.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
if (e.RowIndex >= 0)
{
DataGridViewRow row = this.gridCustomer.Rows[e.RowIndex];
var selectedItme = row.Cells["Id"].Value;
var objOrder = orderBusiness.OrderFindById(Convert.ToInt32(selectedItme));
gridOrder.DataSource = objOrder;
}
}