Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a web form on that while selecting, System Name from drop down list all install hardware name displayed in gridview1, now i using dropdownlist2 after selecting from dropdownlist2 and while adding ADD button selected hardware list displaying in GridView2, i can Add multiple rows in gridview2. Now while pressing save button all the GridView2 records Saved in database displaying in gridview1. Now I want Save gridview2 in database and display in gridview1 while pressing Save button, All the rows of GridView2 should get clear.

Please help me to find out the solution, better if i will get the code.
Thanks in Advance
Posted
Updated 7-Apr-12 2:25am
v2
Comments
Nilesh Patil Kolhapur 7-Apr-12 8:26am    
failed to understand ur question clarify more

1 solution

If you want to clear a GridView you remove the datasource

C#
GridView.DataSource = null;


Extremely easy for one who done more complicated operations with dropdowns and grids. Did you?
 
Share this answer
 
Comments
rishimuni 10-Sep-13 2:45am    
GridView.DataBind()
rishimuni 10-Sep-13 2:45am    
Add both
GridView.DataSource = null;
GridView.DataBind();

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