Click here to Skip to main content
15,908,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Can you help me please? :-\

How to delete selecte all data just from gridview?
I do not want to delete data from sql server(My tables).
Posted
Updated 23-Nov-10 20:22pm
v2
Comments
raheleh_es 24-Nov-10 2:24am    
PLz ask me in windows
Sunasara Imdadhusen 28-Nov-10 23:48pm    
Yes, you can use Delete method of DataTable

Hi
You can delete Row from DataTable and then rebind your DataGrid.


Please do let me know, if you have any doubt.

Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.

Thanks,
Imdadhusen
 
Share this answer
 
On click of delete button. just give the below code...
dt.Rows.Remove() // here u give which row u want to delete
grid.DataSource = dt
grid.Databind()
 
Share this answer
 
v3
Comments
Dalek Dave 24-Nov-10 3:48am    
Good Call.
Sunasara Imdadhusen 24-Nov-10 5:11am    
Good answer!
If you get the Row Id, then passed to query via.
then execute the query statement of 'DELETE'.
 
Share this answer
 
v2

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