private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.Columns[e.ColumnIndex].Name == "Operate")
     {
         //可以在此打开新窗口,把参数传递过去
         model.HouseEstateID   = Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
         model.HouseEstateName = this.dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
         frmProjectEdit fm = new frmProjectEdit();
         fm.ShowDialog();
     }
 }
 private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dataGridView1.Columns[e.ColumnIndex].Name == "Operate")
     {
         //可以在此打开新窗口,把参数传递过去
         model.ID             = Convert.ToInt32(this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString());
         model.Number         = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
         model.Name           = this.dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
         model.DevelopCompany = this.dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
         model.IdentityNumber = this.dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
         model.ProjectArea    = this.dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString();
         frmProjectEdit fm = new frmProjectEdit();
         fm.ShowDialog();
     }
 }
Esempio n. 3
0
 private void dgvDataSource_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvDataSource.Columns[e.ColumnIndex].Name == "Operate")
     {
         //可以在此打开新窗口,把参数传递过去
         model.ID             = Convert.ToInt32(this.dgvDataSource.Rows[e.RowIndex].Cells["ID"].Value.ToString());
         model.Number         = this.dgvDataSource.Rows[e.RowIndex].Cells["Number"].Value.ToString();
         model.Name           = this.dgvDataSource.Rows[e.RowIndex].Cells["Name"].Value.ToString();
         model.DevelopCompany = this.dgvDataSource.Rows[e.RowIndex].Cells["DevelopCompany"].Value == null?"":this.dgvDataSource.Rows[e.RowIndex].Cells["DevelopCompany"].Value.ToString();
         model.IdentityNumber = this.dgvDataSource.Rows[e.RowIndex].Cells["IdentityNumber"].Value == null?"": this.dgvDataSource.Rows[e.RowIndex].Cells["IdentityNumber"].Value.ToString();
         model.ProjectArea    = this.dgvDataSource.Rows[e.RowIndex].Cells["ProjectArea"].Value.ToString();
         frmProjectEdit fm = frmProjectEdit.GetInstance(model);
         fm.Exec(model);
         fm.ShowDialog();
     }
 }