473,657 Members | 2,934 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_workin g

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 1214
I'm currently doing a similar requirement .. though still not complete
...
there are quiter a few approaches .. search for one on using
objectdatasourc e .. 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***@discussi ons.microsoft.c om> wrote in message
news:7B******** *************** ***********@mic rosoft.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_workin g

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
1619
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 the item is not the problem. The problem is that the dropdown object is not instantiated at the point at which the Edit button is clicked, or at any other obvious step in the process. In other words, when a user clicks the Edit (EditCommand)...
2
6922
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 datagrid. Is there anything I missed? and where can I find something for reference? Thanks. Here is html code snippets.
3
7306
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, but I can't seem to add a blank item to the top of the dropdown list. I've tried using the code to add this by placing it in both the page_load and the datagrid.itemDataBound event, but neither seems to work. I've also referenced the control by
1
1962
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 Dropdown item selection is applied to the next dropdown list. Is there any way to fix this problem?
6
5393
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 am receiving errors when trying to set the selected value of the dropdown within the ItemDataBound() subroutine. Below is the code I am using. I hope someone can tell me if this is possible. '''HTML''' <asp:datagrid id="dgAssignments"...
2
2846
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 appears in the cell, but allways the first item in the dropdown box is shown not the current cell value? How do I make the current value in the cell automaticaly be selected in the dropdown box.
0
2906
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 strDataValueField; string strDataTextField; public CreateEditItemTemplateDDL(string DDLName,string DataValueField,string
6
5847
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 ID="FldType_add" Runat="server" DataSource='< %#GetFieldType()%>' DataValueField="Type" DataTextField="Type" /> Oce the page is loaded all the values are added to the dropdown list. But when I thought of getting the selected value from the...
4
1444
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 studentname in second dropdown related to their class selected in first dropdown. >plz help me in above. >Remember i am using both dropdown in a datagrid.......... Thanks.
0
8302
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8499
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.