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. Populate a combobox on a DataGridView control [modified]

Populate a combobox on a DataGridView control [modified]

Scheduled Pinned Locked Moved Visual Basic
helptutorialcsharpwpf
1 Posts 1 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.
  • D Offline
    D Offline
    DA_Loring
    wrote on last edited by
    #1

    Hi, I am fairly new to VB.net and I am stuck on how to populate the list portion of a combo box that is part of a DataGridView control I have got as far as using the example code on the MS Help, which is for a text box, and changed it to a combo box, and I have prepared a binding source with the data, but I cannot see anything in the properties that lets me attach the binding source to the combo box Private Sub CustomiseUnitsColumn() 'Creates the drop down boxes for the units Dim column As DataGridViewColumn = sggData.Columns("Unit ID") Dim cell As DataGridViewCell = New DataGridViewComboBoxCell column.CellTemplate = cell End Sub Can anyone point me in the right direction?:confused: Er actually the 'cell' thing does not work either. I get the message: System.InvalidCastException was unhandled Message="Value provided for CellTemplate must be of type System.Windows.Forms.DataGridViewTextBoxCell or derive from it." Source="System.Windows.Forms" I am even more confused now!:confused::confused: -- modified at 11:38 Friday 30th March, 2007 -- modified at 11:41 Friday 30th March, 2007

    David Loring !! Keep Music Live !!

    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