Click here to Skip to main content
12,398,225 members (52,043 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 7-Apr-12 2:22am
Namit KB1.3K
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

If you want to clear a GridView you remove the datasource

GridView.DataSource = null;

Extremely easy for one who done more complicated operations with dropdowns and grids. Did you?
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 7 Apr 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100