add textbox in asp:gridview

Posted by Kannan1986 under ASP.NET on 2/27/2010 | Views : 16477 | Status : [Member] | Replies : 3
Hi,
hi i want to add textbox in gridview at last column.




Responses

Posted by: Abhijit Jana on: 2/27/2010 [Member] [MVP] Bronze

Up
0
Down
This can be easily done by "TemplateField".

You need to use Template Field in your last column, Just put the textbox. That's All. You can access that control using GridView.FindControl() method.

For your reference,
http://www.asp.net/%28S%28ywiyuluxr3qb2dfva1z5lgeg%29%29/learn/data-access/tutorial-12-cs.aspx

Cheers !
Abhijit

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 3/2/2010 [Member] Bronze

Up
0
Down
check following link

http://stackoverflow.com/questions/902231/add-columns-with-textboxes-in-gridview-using-c

<asp:TemplateField HeaderText="Qty">

<ItemTemplate>
<asp:TextBox ID="tbQty" runat="server" Width="25px"
MaxLength="3" />
</ItemTemplate>
<ItemStyle Width="25px" HorizontalAlign="Center"/>
</asp:TemplateField>


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ajaydabhade on: 3/10/2010 [Member] Starter

Up
0
Down
<asp:TemplateField HeaderText="Email Id">
<ItemTemplate>
<asp:TextBox id="txtEmail" runat="server" ValidationGroup="vgUser" ></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>


AJAY DABHADE
(MCPD, MCTS)
"Plan your work, work on your plan and your plan will work."

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response