Dropdown list in a datagrid

Discussion in 'ASP .Net' started by =?Utf-8?B?V2FyYW4=?=, Mar 28, 2006.

  1. 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
     
    =?Utf-8?B?V2FyYW4=?=, Mar 28, 2006
    #1
    1. Advertisements

  2. =?Utf-8?B?V2FyYW4=?=

    hangar18 Guest

    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 ..
     
    hangar18, Mar 28, 2006
    #2
    1. Advertisements

  3. 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" <> wrote in message
    news:...
    > 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
     
    Eliyahu Goldin, Mar 28, 2006
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michelle

    bounding for dropdown list in datagrid

    Michelle, Jul 7, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    516
    [ MVP ] Sukesh Ashok Kumar
    Jul 12, 2003
  2. vishnu
    Replies:
    1
    Views:
    1,432
    Patrick.O.Ige
    Mar 25, 2006
  3. =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?=

    Dropdown List - Check if value exists in list prior to selection

    =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?=, Mar 10, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    2,205
    =?Utf-8?B?QnJlbmRlbg==?=
    Mar 20, 2007
  4. =?Utf-8?B?RGF2ZSBU?=

    Columns in Dropdown list and list box

    =?Utf-8?B?RGF2ZSBU?=, Jun 25, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    606
    jufemaiz: jc
    Jun 27, 2007
  5. mldardy
    Replies:
    1
    Views:
    897
    mldardy
    Dec 10, 2008
  6. M. Craig

    How to set background color of List item in dropdown list

    M. Craig, Nov 12, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    443
    M. Craig
    Nov 12, 2003
  7. M. Craig
    Replies:
    1
    Views:
    936
    Victor Garcia Aprea [MVP]
    Jan 9, 2004
  8. Bryan Stauffer

    Dropdown List doesn't know what's in it's list

    Bryan Stauffer, Jul 6, 2006, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    246
Loading...