We help IT Professionals succeed at work.

Dynmically create dropdownlist inside gridview

itinfo7 used Ask the Experts™
I want to create dynamic dropdownlist inside Gridview control.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="4" ForeColor="Black" GridLines="Horizontal" Height="241px" 
                <asp:TemplateField HeaderText="designation">
                        <asp:DropDownList ID="dd_desghnation" runat="server">
                            <asp:ListItem> --Select--</asp:ListItem>
            <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
            <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />

Something like this...I don't know how can I do that....

Open in new window

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Director
You can use the visual studio control.  In design view click the tag on the upper eight of the grid.  Choose edit templates.  Choose the itrem you want and the view.  Delete the text box.  Drag a combobox from the tool bar into the view.  Bind it to the dataset field and choose items.