Click here to Skip to main content
15,867,851 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to add the textbox and dropdown list to the datagridview(in winform's application) same column.Is it possible? if it is possible let me know.......
Posted
Updated 20-Feb-13 18:23pm
v2
Comments
[no name] 21-Feb-13 0:18am    
yes it is possible.
within gridview's template field u cn add both the controls within same
template field.

Use ItemTemplate.
You can add controls in
C#
<asp:itemtemplate xmlns:asp="#unknown">your controls </asp:itemtemplate>

as in Example
C#
<asp:TemplateField HeaderText="FirstName" SortExpression="FirstName">

    <EditItemTemplate>

        <asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("FirstName") %>'></asp:TextBox>

    </EditItemTemplate>

    <ItemTemplate>

        <asp:Label ID="Label1" runat="server" Text='<%#
Bind("FirstName") %>'></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Text='<%#
Bind("FirstName") %>'></asp:TextBox>
    </ItemTemplate>

</asp:TemplateField>
 
Share this answer
 
v2
yes you can add multiple contorls inside one column in gridview.
 
Share this answer
 
Comments
Shekhar Reddy.N 21-Feb-13 0:33am    
How can i do,
may i know that?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900