Solved

Deleting DataGridViewRow with Underlying DataRelation

Posted on 2006-06-26
4
359 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
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)…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

749 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