Solved

Deleting DataGridViewRow with Underlying DataRelation

Posted on 2006-06-26
4
361 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 500 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

Stressed Out?

Watch some penguins on the livecam!

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 basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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