?
Solved

Deleting DataGridViewRow with Underlying DataRelation

Posted on 2006-06-26
4
Medium Priority
?
362 Views
Last Modified: 2008-02-01
Hi,

I have a DataGridView which is populated from a DataTable that has a foreign key constraint linking it to another DataTable.

When I delete a row in the DataGridView that the second DataTable depends on, the DataError event is fired because the deletion will cause orphan rows in the second DataTable.

Is there any way to delete/remove a row from the DataGridView (rendering it not visible to the user) without deleting it in the underlying DataTable?

This would be useful becuase I never want to physically delete records, but rather to set a boolean flag indicating it as deleted.

Thanks.
0
Comment
Question by:AMLabels
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16985941
Me.DataGridView1.Rows(0).Visible = False

Bob
0
 

Author Comment

by:AMLabels
ID: 16990565
I tried setting the row visible to false, but the application throws an error stating that the operation was not allowed in the current context.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 16996716
Me.DataGridView1.Rows(0).Height = 0

Bob
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17000126
Not a good enough answer?  Did you manage to do something else?  What was your final solution?

Bob
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question