Click here to Skip to main content
15,570,042 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a question regarding Gridview in asp.net. I need Textbox for particular cell in Gridview column. I am using Visual studio 2015. Whether it is possible.

What I have tried:

I have tried for particular column but I need for particular cell
Posted
Updated 9-May-18 6:18am

1 solution

You can disable AutoGenerateColumn per your dataset assigned and add TextBox control as below.

<asp:GridView ID="GridView1"  runat="server" AutoGenerateColumns="false">
 <Columns>
  <asp:TemplateField>
   <ItemTemplate>
     <asp:TextBox ID="text1" runat="server" />
   </ItemTemplate>
  </asp:TemplateField>
</Columns>
</asp:GridView>
 
Share this answer
 
Comments
Member 13818561 10-May-18 1:27am    
Thank you sir for your reply.
But I have a condition. The textbox must appear for only one cell of particular row. For the remaining rows in a Gridview textboxes shouldn't appear. For example if I have 3 rows in a Gridview the text box must appear for only 1 row. Means In that row for only 1 cell.
Herman<T>.Instance 15-May-18 7:17am    
That is when you set GridView.EditIndex to the rownumber where the TextBox should appear
Member 13818561 15-May-18 8:46am    
Ok sir. thank you. Let me check.

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