Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
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
Edited 20-Feb-13 19:23pm
v2
Comments
CodeMaster_Noob at 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
good
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">
 
    <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>
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

yes you can add multiple contorls inside one column in gridview.
  Permalink  
Comments
Shekhar Sree at 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
0 Sergey Alexandrovich Kryukov 565
1 Maciej Los 359
2 Kornfeld Eliyahu Peter 309
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2014
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