private void zapisz_btn_Click(object sender, EventArgs e) { if (dataGridView1.Rows.Count > 0) { string val = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells["id"].Value.ToString(); DataRow[] res = _logic.Table.Select(String.Format("id = {0}", val)); string title = res[0][0].ToString(); //_logic.Table.Rows[dataGridView1.CurrentCell.RowIndex].Field<string>(0); string desc = res[0][1].ToString(); //_logic.Table.Rows[dataGridView1.CurrentCell.RowIndex].Field<string>(1); Int64 id = int.Parse(res[0][3].ToString()); // _logic.Table.Rows[dataGridView1.CurrentCell.RowIndex].Field<Int64>(3); ed = new edit(this, title, desc, id); ed.ShowDialog(); } }
private void button1_Click(object sender, EventArgs e) { edit newMessage = new edit(this); newMessage.ShowDialog(); }