Link to home
Start Free TrialLog in
Avatar of keziah0815
keziah0815

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of Bahnass
Bahnass
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of keziah0815
keziah0815

ASKER

Thank you very much!It worked!
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)
If u r working in bounded mode with dataset then just
use it ds.Clear() method.
If u r working in bounded mode with dataset then just
use it ds.Clear() method (I tried it in C# working ok).
Going back to the database is not the best method.

Simply do this:

myGrid.DataSource = Nothing
MyGrid.DataBind()