Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Deleting DataGridViewRow with Underlying DataRelation

Posted on 2006-06-26
4
Medium Priority
?
364 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

618 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