?
Solved

Delete dataGrid row bind to dataTable with Delete button

Posted on 2004-09-18
2
Medium Priority
?
227 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
[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
2 Comments
 
LVL 5

Accepted Solution

by:
tomasX2 earned 375 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 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