473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Dropdown list in a datagrid

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
Mar 28 '06 #1
2 1201
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 ..

Mar 28 '06 #2
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

"Waran" <Wa***@discussions.microsoft.com> wrote in message
news:7B**********************************@microsof t.com...
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

Mar 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Philip Townsend | last post by:
I have a datagrid that contains a dropdown list that is part of an EditItemTemplate. I need to run some code when the dropdown list builds in order to preselect an item in the list. Preselecting...
2
by: Michelle | last post by:
Hello, I put a dropdown list in ItemTemplate Column. I can select its value from the dropdown list and store in a dataset, but when I retrieve records from dataset, it doesn't show up in the...
3
by: Big Dave | last post by:
I know it's been asked a million times before, but I still can't seem to find an answer that works. I've got a dropdown list in the footer template of a datagrid. The dropdown list databinds,...
1
by: Vijay Kerji | last post by:
Hi, I have a datagrid with dropdown list and Remove hyperlink in it as columns. When I remove a row from the datagrid, Dropdown list selection is retaining its previous value. i.e, removed...
6
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I...
2
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
4
by: youvrajasnsm | last post by:
Hi All, >I am using datagrid control in asp.net with C#. >I have two dropdown list in datagrid e.g. one dropdown have Classname and another have Studentname. >now I want to show all the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.