Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to export data from a DataGridView?

How to export data from a DataGridView?

Scheduled Pinned Locked Moved C#
helptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Khoramdin
    wrote on last edited by
    #1

    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

    A 2 Replies Last reply
    0
    • K 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. khoramdin

      A Offline
      A Offline
      Alireza Loghmani
      wrote on last edited by
      #2

      hello 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)

      1 Reply Last reply
      0
      • K 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. khoramdin

        A Offline
        A Offline
        Alireza Loghmani
        wrote on last edited by
        #3

        hello 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)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups