CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2005
    Posts
    224

    combo box in Grid view

    Hi all

    in my requirement in need to show

    the list of users and need to place a combo box for every user , so that
    i can assign a role to that perticular user as Team lead,Project Manager,User like that

    How can i do this

    Regards

    TIS

  2. #2
    Join Date
    Mar 2006
    Location
    Craiova, Romania
    Posts
    439

    Re: combo box in Grid view

    Bogdan

    If someone helped you then please Rate his post and mark the thread as Resolved
    Please improve your messages appearance by using tags [ code] Place your code here [ /code]

  3. #3
    Join Date
    Jan 2005
    Posts
    224

    Re: combo box in Grid view

    Thank for your reply

    The suggested thing is working in windows bassed application

    i am working on web based one

    in web based we dont have datagridcomboboxcolumn


    is there any other solution

  4. #4
    Join Date
    Oct 2005
    Location
    Islamabad, Pakistan
    Posts
    1,277

    Re: combo box in Grid view

    Add templateField to gridview and set its datasource to roles list.
    Code:
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" DataSourceID="Company" Width="400px">
                <Columns>
    	..
    	..
                    <asp:TemplateField HeaderText="Roles">
                        <ItemTemplate>
                            <asp:DropDownList ID="DropDownList1" DataSource='<%# GetRolesList() %>' runat="server">
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
    Code:
        protected List<string > ddlItems()
        {
            List<string > lstRoles=new List<string>() ;
    
            lstRoles.Add("Role1");
            lstRoles.Add("Role2");
            lstRoles.Add("Role3");
            
            return lstRoles;
        }

  5. #5
    Join Date
    Jan 2005
    Posts
    224

    Re: combo box in Grid view

    Thanks a lot
    Attached Files Attached Files
    Last edited by tis707; July 2nd, 2007 at 07:52 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured