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 17:49pm
Edited 20-Feb-13 18: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 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?
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

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



Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid