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

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

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

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. vishnu
    Replies:
    1
    Views:
    1,217
    Patrick.O.Ige
    Mar 25, 2006
  2. Mike
    Replies:
    1
    Views:
    820
  3. acadam
    Replies:
    0
    Views:
    764
    acadam
    Dec 27, 2006
  4. Replies:
    2
    Views:
    442
  5. Steve Myers
    Replies:
    2
    Views:
    280
    Steve Myers
    Nov 20, 2003
Loading...

Share This Page