void gvPurchasePlanList_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1 && e.ColumnIndex > -1)//双击表头或列头时不起作用 { string viewfile = gvPurchasePlanList.Columns[e.ColumnIndex].DataPropertyName; if (viewfile == "relation_order") { string parts_name = this.gvPurchasePlanList.CurrentRow.Cells["parts_name"].Value.ToString(); string plan_count = this.gvPurchasePlanList.CurrentRow.Cells["business_count"].Value.ToString(); string finish_count = this.gvPurchasePlanList.CurrentRow.Cells["finish_count"].Value.ToString(); string relation_order = lblorder_num.Text; string parts_code = this.gvPurchasePlanList.CurrentRow.Cells["parts_code"].Value.ToString(); frmRelationOrder frm = new frmRelationOrder(parts_name, plan_count, finish_count, relation_order, parts_code); frm.ShowDialog(); } } }