Dropdown list in a datagrid

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
 
H

hangar18

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 ..
 
E

Eliyahu Goldin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top