Click here to Skip to main content
Rate this: bad
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
Edited 7-Apr-12 2:25am
Nilesh Patil Kolhapur at 7-Apr-12 8:26am
failed to understand ur question clarify more

1 solution

Rate this: bad
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?
rishimuni at 10-Sep-13 2:45am
rishimuni at 10-Sep-13 2:45am
Add both
GridView.DataSource = null;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 345
1 Gihan Liyanage 332
2 OriginalGriff 283
3 ClimerChinna 222
4 Zoltán Zörgő 170
0 Sergey Alexandrovich Kryukov 8,243
1 OriginalGriff 7,109
2 CPallini 2,598
3 Richard MacCutchan 1,980
4 Abhinav S 1,778

Advertise | Privacy | Mobile
Web02 | 2.8.140826.1 | Last Updated 7 Apr 2012
Copyright © CodeProject, 1999-2014
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