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. Visual Studio
  4. Add value in Combobox from the Datagriedview

Add value in Combobox from the Datagriedview

Scheduled Pinned Locked Moved Visual Studio
help
2 Posts 2 Posters 10 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.
  • U Offline
    U Offline
    User 13579954
    wrote on last edited by
    #1

    Hello everyone, I'm trying to create one code to add value in combobox from my Datagriedview.

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        DataGridView1.Rows.Add(ComboBox1.Text)
        ComboBox1.Items.Add(DataGridView1.Rows.Add(ComboBox1.Text))
    
    End Sub
    

    End Class

    But the simple code doesn't work.Could you help me please. Nice day.

    L 1 Reply Last reply
    0
    • U User 13579954

      Hello everyone, I'm trying to create one code to add value in combobox from my Datagriedview.

      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

          DataGridView1.Rows.Add(ComboBox1.Text)
          ComboBox1.Items.Add(DataGridView1.Rows.Add(ComboBox1.Text))
      
      End Sub
      

      End Class

      But the simple code doesn't work.Could you help me please. Nice day.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I do not know what you expect from that second line of code, but I think you may need to study DataGridViewRowCollection.Add Method (Object[]) (System.Windows.Forms)[^].

      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