问题描述
我有一个网格视图来显示数据库中的所有记录。现在我需要一个搜索框。所需的设计是这样的。
名称|地址|联系
所有记录都以网格显示。第一行显示列标题,第二行显示数据库中的记录..现在我想在第二行(即在各自的列标题下面)中的文本框和第三行中的数据库记录。如果用户在列标题名称下方的文本框中输入名称。必须根据名称进行搜索..我在.aspx页面中使用标题模板标签尝试了几个标签,但无法获得所需的输出。任何帮助???
i have a grid view to display all the records from database.. Now I require a search box. the required design goes like this.
Name | Address | Contact
All the records are displayed in grid. first row displayed the column header and second row displays record from database.. now i want a text boxes in second row (i.e. below respective column header) and record from database in 3rd row. If user enters the name in textbox below column header name. the search must be done based on the name.. I had tried few tags in .aspx page using header template tag but could not get desired output. Any help???
推荐答案
protected void grd_RowEditing(object sender, GridViewEditEventArgs e)
{
GridViewRow selectRow = grd.Rows(e.NewEditIndex);
TextBox txtKj=(TextBox)selectRow.Cells[3].FindControl("txtKjId");
}
希望这个帮助。
-SG
Hope this help.
-SG
这篇关于在网格视图的行中添加文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!