Click here to Skip to main content
13,301,619 members (65,323 online)
Rate this:
Please Sign up or sign in to vote.
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 20-Feb-13 18:49pm
Updated 20-Feb-13 19:23pm
CodeMaster_Noob 21-Feb-13 0:18am
yes it is possible.
within gridview's template field u cn add both the controls within same
template field.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

as in Example
<asp:TemplateField HeaderText="FirstName" SortExpression="FirstName">
        <asp:TextBox ID="TextBox1" runat="server" Text='<%#
Bind("FirstName") %>'></asp:TextBox>
        <asp:Label ID="Label1" runat="server" Text='<%#
Bind("FirstName") %>'></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Text='<%#
Bind("FirstName") %>'></asp:TextBox>
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

yes you can add multiple contorls inside one column in gridview.
Shekhar Sree 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171207.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100