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

Posted on 2005-04-12
Medium Priority
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

Accepted Solution

rodmjay earned 2000 total points
ID: 13766359
LVL 70

Expert Comment

by:Éric Moreau
ID: 13767905

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

809 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