如何使用ASP.NET在gridview中的特定单元格中添加文本框 [英] How to add textbox in particular cell in gridview using ASP.NET

查看:478
本文介绍了如何使用ASP.NET在gridview中的特定单元格中添加文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net中有关于Gridview的问题。我需要在Gridview列中为特定单元格设置Textbox。我正在使用Visual Studio 2015.是否有可能。



我尝试过:



我已尝试过特定列,但我需要特定的单元格

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

推荐答案

您可以根据分配的数据集禁用AutoGenerateColumn,并添加TextBox控件,如下所示。



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>


这篇关于如何使用ASP.NET在gridview中的特定单元格中添加文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆