Clearing rows from the datagrid

I've been using the datagrid for loading items from the database but I would like to know how to clear all its contents without affecting the table from the database?
keziah0815Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
BahnassConnect With a Mentor Commented:
I think
Simply U can't Unless U Unbound it, rebound it by another
Table / Query!!   (even empty one)

this select will select no record

SET mygrid.RecordSource = "SELECT MyTable WHERE FALSE"
0
 
keziah0815Author Commented:
Thank you very much!It worked!
0
 
BahnassCommented:
Dear if It worked!    

WHY GRADE B ????

:-(

This may prevent Experts from helping U again and makes EE users hisitate to get this from PAQ

(if U think it is so simple Q just put only 50 point)
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
FaysalnadeemCommented:
If u r working in bounded mode with dataset then just
use it ds.Clear() method.
0
 
FaysalnadeemCommented:
If u r working in bounded mode with dataset then just
use it ds.Clear() method (I tried it in C# working ok).
0
 
tssmithdoggCommented:
Going back to the database is not the best method.

Simply do this:

myGrid.DataSource = Nothing
MyGrid.DataBind()
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.