Click here to Skip to main content
15,922,407 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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???
JoCodes 1-Oct-13 5:59am    
which approach you have already tried out?
JoCodes 1-Oct-13 6:26am    
Please change your subject line too according to get more accurate responses since its just about adding textbox as row in gridview
Codes DeCodes 1-Oct-13 7:43am    
thanks for the reply jocodes.. I had tried with

<asp:TextBox ID="TextBoxEmployee" runat="server"/>

it was just a try and the textbox was shown in header as expected..
JoCodes 1-Oct-13 8:02am    
I have posted a link as a solution which takes care of your inline search scenario..
Codes DeCodes 2-Oct-13 0:26am    
ya. got it.. thats a clever technique though.. I was searching for input box using grid view.. Not as a table. Nyway thanks for your help..

on click of row event of grid you can add code like this to create a textxbox.

protected void grd_RowEditing(object sender, GridViewEditEventArgs e) 
     GridViewRow selectRow = grd.Rows(e.NewEditIndex);
     TextBox txtKj=(TextBox)selectRow.Cells[3].FindControl("txtKjId"); 

Hope this help.
Share this answer
Codes DeCodes 2-Oct-13 5:13am    
I am developing the solution in version 3.5 and (e.NewEditIndex) is not supported.. do u have any idea ??
You can try something in the below link which takes care of your search need exactly ( inline Gridview search feature )

Integrating Inline Search in a GridView's Header[^]

Hope this helps

[Edit member="Tadit"]
Link text added to reflect the article title.
Share this answer
Share this answer
<asp:templatefield headertext="xxx" xmlns:asp="#unknown">


<asp:textbox runat="server" id="Duties" text="<%#Eval(" xxx")="" %&gt;"="" clientidmode="Static">

Share this answer

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