.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Delete the selected row in datagridview

Posted By: srini     Posted Date: February 08, 2011    Points:2   Category :VB.Net
Hi,

How to delete the selected row in DataGridView? But i dont want to delete it from the SQL server 2005 database(Only in DGV).






Responses
Author: shankey             
Posted Date: February 08, 2011     Points: 5   

hi,

Have a look at following link
http://msdn.microsoft.com/en-us/library/5s3ce6k8.aspx#Y2964

Shankey
Author: Blessy Baby             
Posted Date: February 09, 2011     Points: 5   

Hi,

You can use RemoveAt functionality for datagrid
this.dataGrid1.Rows.RemoveAt(this.dataGrid1.SelectedRows[0].index)

Blessy Baby
Project Lead
Digitalmesh Softech India (p) Limited
Cochin,Kerala
Author: srini             
Posted Date: February 09, 2011     Points: 5   

Hi Blessy,

Do you know about Softdelete? If yes,please help me.

I want to delete the selected row in DGV,but it remains in the SQL Server 2005 database.

I am using Is_Active field and datatype is "bit".




Srini
Author: Sagar Pardeshi             
Posted Date: February 09, 2011     Points: 5   

hi

check Following Code

If Not(dr.IsNewRow) Then dgwListSale.Rows.Remove(dr)


Author: Maverick             
Posted Date: March 07, 2011     Points: 20   

Hello,

You can use IsDeleted flag in your database table. Set it to true when it is deleted from the UI and then bind the grid for all the columns having ISDeleted to false. This is soft delete. Hope it helps.

Thanks,
Maverick

Thanks,
Maverick


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend