How to use one of the column as combo box in datagrid control (Windows Forms) ?

Posted on 2005-04-12
Last Modified: 2012-05-05


I have the following tables in the database.

   EmployeeID  |  Name  |  CityID
      1             |  kishore | 10
      2             | Suresh  |  20
      3             | Rao      |  30

           CityID     |       CityName
             10       |       Chicago
             20       |       Atlanta
             30       |       St.Lowis

Now in i want to show the data in the datagrid control. When ever i want to insert a new row or udate the row, i should have the City column as combo box populated with "DataTextField" and "DataValueField". I am going to store the "cityid" in the "Employee" table. And i have to fill the combo box with "Cities" table.

Can you please provide the sample code ?

Advance Thanks for your time & patience.

Question by:kishore_peddi
    LVL 8

    Accepted Solution

    LVL 69

    Expert Comment

    by:Éric Moreau

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now