Solved

Delete dataGrid row bind to dataTable with Delete button

Posted on 2004-09-18
2
221 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 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