How to export data from a DataGridView?
-
Hello everyone, I can use the following code to export Text from a selected cell in the DataGridView into a TextBox.
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { textBox1.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["DayInfo"].Value.ToString(); }
Can someone tell me how I can export an image and display it in a PictureBox? Thank you very much for your help and have a great day. khoramdin -
Hello everyone, I can use the following code to export Text from a selected cell in the DataGridView into a TextBox.
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { textBox1.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["DayInfo"].Value.ToString(); }
Can someone tell me how I can export an image and display it in a PictureBox? Thank you very much for your help and have a great day. khoramdinhello to khoramdin you can use this code for load a picture to a picturebox from a datagridview cell: in CellContentClick event you can type this code: pictureBox1.Image = Image.FromFile(dataGridView1.CurrentCell.Value.ToString()); Good Luck.:-D Editali (Alireza Loghmani)
-
Hello everyone, I can use the following code to export Text from a selected cell in the DataGridView into a TextBox.
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { textBox1.Text = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["DayInfo"].Value.ToString(); }
Can someone tell me how I can export an image and display it in a PictureBox? Thank you very much for your help and have a great day. khoramdinhello to khoramdin you can use this code for load a picture to a picturebox from a datagridview cell: in CellContentClick event you can type this code: pictureBox1.Image = Image.FromFile(dataGridView1.CurrentCell.Value.ToString()); Good Luck. Editali (Alireza Loghmani)