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 convert a column in gridview to combobox after binding??

how to convert a column in gridview to combobox after binding??

Scheduled Pinned Locked Moved C#
csharpdatabasewpfwcflinq
2 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.
  • L Offline
    L Offline
    leeoze 0
    wrote on last edited by
    #1

    I use linq to sql. I have a table of employees belong to a company by forigen key as companyID on the employees table. (I have compamies table as my main table) the linq does it by it's self and knows that the two are related and after binding the context to the datagridview I get the employees table + column of the company name. my goal is to convert or some how get to the point where I have a coulmn of the employee name and a combobox coulmn of the company which will be bound the companyID. so when I change the company it will know to update the companyID when I submit_changes() on linq context. tnx

    L 1 Reply Last reply
    0
    • L leeoze 0

      I use linq to sql. I have a table of employees belong to a company by forigen key as companyID on the employees table. (I have compamies table as my main table) the linq does it by it's self and knows that the two are related and after binding the context to the datagridview I get the employees table + column of the company name. my goal is to convert or some how get to the point where I have a coulmn of the employee name and a combobox coulmn of the company which will be bound the companyID. so when I change the company it will know to update the companyID when I submit_changes() on linq context. tnx

      L Offline
      L Offline
      leeoze 0
      wrote on last edited by
      #2

      DataPropertyName I added a new combobox column during runtime and bound it to the companies table. set the valuemember and displaymember, and defined DataPropertyName to the same column name as the one I need it to be bound to and vwalla... any changes made to the combobox saves it automaticly to the database (need to add an event on cell changes the have the context submit_changes() function)

      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