Solved

Delete dataGrid row bind to dataTable with Delete button

Posted on 2004-09-18
2
218 Views
Last Modified: 2008-02-26
Hi all,

I'm trying to delete a row through datagrids currentrowindex with a good old button.
Thing is I'm filling up the datagrid (dataset) with comboboxes and textboxes, yadayada...
Problem is when I delete the row using:

         dataTable1.Rows[dataGrid1.CurrentRowIndex].Delete();

In the dataTable it's not always the right one.
For instance if I sort the datagrid all goes bad. (This is disabled for the moment to be able to move on)

Is there a way to trigger the delete-row-event in the datagrid itself?
DataGrid is readonly though to remove the 'new' row!
Is the only way to insert a new column with a unique key?

Thanks,
Pierre
0
Comment
Question by:Targeted
2 Comments
 
LVL 5

Accepted Solution

by:
tomasX2 earned 125 total points
ID: 12094006
0
 

Author Comment

by:Targeted
ID: 12130965
Thanks tomasX2 for the fast answer...

This solved my problem.
Regards,
Pierre
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Chat Room 1 43
Check my code out(2) 2 54
Coding C# in Linux 8 36
designing in object programming 12 52
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now