Dropdown list in a datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I Want to add a dropdown box in a datagrid on Page_Load.

This Datagrid shares two tables.

One table contains Employee details, and the other having the list of
projects the employee is working.

Table 1
-------
Name DOB Address
Emp1 01/01/1976 Address1
Emp2 01/01/1977 Address2
Emp3 01/01/1978 Address3

Table 2
------
Name Projects_working

Emp1 Project1
Emp1 Project2
Emp1 Project3

I need to populate the List of Projects in a dropdownlis on a page load
which is inside the datagrid.

Thanks
Waran
 
I'm currently doing a similar requirement .. though still not complete
...
there are quiter a few approaches .. search for one on using
objectdatasource .. that is pretty cool and easy ..
 
Waran,

You need to make an ItemTemplate that will include a ddl. Then, in the
datagrid's ItemDataBound event you will need to populate the ddl and set the
selected project for every datagrid row.

If all employees share the same list of projects, you can populate a
datatable with the project list before databinding the grid and in the
ItemDataBound event just set the selected project.

Eliyahu
 
Back
Top