Link to home
Start Free TrialLog in
Avatar of kishore_peddi
kishore_peddi

asked on

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



Hi,

I have the following tables in the database.

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

                     Cities
===========================
           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.

Thanks,
Kishore
ASKER CERTIFIED SOLUTION
Avatar of rodmjay
rodmjay
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Éric Moreau