private void repositoryItemButtonEdit1_Click(object sender, EventArgs e) { DataRow DR = gridView1.GetDataRow(gridView1.FocusedRowHandle); Program.gdvid = DR["PN"].ToString(); //string GDH = gridView1.GetRowCellValue(0, "jobnum").ToString(); TestBZFrom tbz = new TestBZFrom(); tbz.Show(); }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { // MessageBox.Show(dataGridView1.Columns[e.ColumnIndex].Name); TestBZFrom tb = new TestBZFrom(); if (e.RowIndex >= 0 && e.RowIndex < dataGridView1.Rows.Count && e.ColumnIndex >= 0 && e.ColumnIndex < dataGridView1.Columns.Count) { if (dataGridView1.Columns[e.ColumnIndex].Name == "remark") { tb.LjHao = dataGridView1.Rows[e.RowIndex].Cells["componentId"].Value.ToString(); tb.Show(); } // 数模处理 if (e.ColumnIndex == 7) { string cur_dir = System.Environment.CurrentDirectory; ofd_sm.InitialDirectory = cur_dir + "\\shumo"; if (this.ofd_sm.ShowDialog() == DialogResult.OK) { MessageBox.Show(ofd_sm.FileName); } this.dataGridView1.CurrentCell.Value = Path.GetFileName(ofd_sm.FileName); } if (e.ColumnIndex == 8) { string cur_dir = System.Environment.CurrentDirectory; ofd_sm.InitialDirectory = cur_dir + "\\images"; if (this.ofd_sm.ShowDialog() == DialogResult.OK) { MessageBox.Show(ofd_sm.FileName); } this.dataGridView1.CurrentCell.Value = Path.GetFileName(ofd_sm.FileName); } } else { // MessageBox.Show("选中了无效的行"); } }
/// <summary> /// 测试 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { TestBZFrom tbz = new TestBZFrom(); tbz.Show(); }