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 Basic
  4. How to select Item from DataGridViewComboBoxCell in Datagridview

How to select Item from DataGridViewComboBoxCell in Datagridview

Scheduled Pinned Locked Moved Visual Basic
csswpfwcfhelptutorial
2 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.
  • A Offline
    A Offline
    Amit Agarrwal
    wrote on last edited by
    #1

    hello, I have a Combobox in My Grid. I have bound this Combobox by datasource. Suppose values in Combobox After binding (x,y,z); I have a checkbox on form. i get some value like "x" After clicking on checkbox, what i want when i click on checkbox this x value should be selected in ComboBox. for this I'm trying following code DataGridViewComboBoxCell cboCell = this.dgvQueryPane.Rows[CurrentRowIndex].Cells[CurrentCellName] as DataGridViewComboBoxCell; cboCell.Value = x; but its not working....can anyone please help me.....

    Amit Agarwal

    M 1 Reply Last reply
    0
    • A Amit Agarrwal

      hello, I have a Combobox in My Grid. I have bound this Combobox by datasource. Suppose values in Combobox After binding (x,y,z); I have a checkbox on form. i get some value like "x" After clicking on checkbox, what i want when i click on checkbox this x value should be selected in ComboBox. for this I'm trying following code DataGridViewComboBoxCell cboCell = this.dgvQueryPane.Rows[CurrentRowIndex].Cells[CurrentCellName] as DataGridViewComboBoxCell; cboCell.Value = x; but its not working....can anyone please help me.....

      Amit Agarwal

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      While I have never used the combo in a gridview I would expect you to have to set the selectedvalue = X of the combo NOT the cell. BTW you posted C# in the VB forum :)

      Never underestimate the power of human stupidity RAH

      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