How to embed drop down with Grid view in

I have a gridview containing data pouplated from table having 5 columns.
I want to add dropdown in 6th column, and textbox in 7th column.
<asp:Gridview id="g1" runat="server"/>
Who is Participating?
Tom BeckConnect With a Mentor Commented:

<asp:GridView ID="g1" runat="server" AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1">
                <asp:BoundField DataField="id" HeaderText="Column 1" />
                <asp:BoundField DataField="randomData" HeaderText="Column 2" />
                <asp:BoundField DataField="sort" HeaderText="Column 3" />
                <asp:BoundField DataField="sort" HeaderText="Column 4" />
                <asp:BoundField DataField="sort" HeaderText="Column 5" />
                <asp:TemplateField HeaderText="Drop Down List">                            
                        <asp:DropDownList ID="ddlTest" runat="server">
                            <asp:ListItem Text="Item 1" Value="item_1"></asp:ListItem>
                            <asp:ListItem Text="Item 2" Value="item_2"></asp:ListItem>
                            <asp:ListItem Text="Item 3" Value="item_3"></asp:ListItem>
                            <asp:ListItem Text="Item 4" Value="item_4"></asp:ListItem>
                <asp:TemplateField HeaderText="Text Box Field">
                        <asp:TextBox ID="txtTest" runat="server" Text="text"></asp:TextBox>                                

Open in new window

searchsanjaysharmaAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.