Click here to Skip to main content
16,020,974 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a gridview("gridview1") which shows data from agent table and i use GridView1_RowUpdating to update the table.I also have a search textbox.The result corresponding to the data entered in the textbox is also shown in gridview1.But i do not know how to write a code so that i can edit this search result too....can somebody help me?


i have a search textbox and a button the same page as the grid view.and have written query for the search in the button_click....i want that result 2 show in the same gridview instead of another one.which happens but when i try 2 edit that search result in the gridview i get the data which originally occured on page load...... how can i write code in the gridview1_rowupdating so it will also work for the search result like for the data which occurs on page_load

Thanks in advance!!!!
Posted
Updated 3-Apr-11 16:29pm
v2
Comments
Sandeep Mewara 3-Apr-11 5:25am    
Not clear. Search is where?

Search Textbox and Grid separate?
Laksh112 3-Apr-11 22:28pm    
i have a search textbox and a button the same page as the grid view.and have written query for the search in the button_click....i want that result 2 show in the same gridview instead of another one.which happens but when i try 2 edit that search result in the gridview i get the data which originally occured on page load...... how can i write code in the gridview1_rowupdating so it will also work for the search result????
Sandeep Mewara 5-Apr-11 4:23am    
Sounds like IsPostback issue only.

you can use the sql command for search by name like...

and for edit you can you the datagrid view property...

if you want to load the new data i.e edited.. then make the different function where datagridview is loaded...
and after edit you can call that function....
 
Share this answer
 
v2
i think you are binding your grid in page load so every time page loads it will bind your gridview again so Check If(!ispostback) condition and clear your grid before binding it again.
 
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