TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arto Kainu
NA
1
0
How to cancel deletion of a row in DataGrid?
Sep 26 2005 7:51 AM
Hi all! I have a Windows Forms app which shows some data in a DataGrid. Everything goes grreat but there's one major problem. I can't solve how to cancel a row delete in the DataGrid. I can cancel the deletion in the DataTable object by calling the RejectChanges() method but still if I call it (I have tested it on both DataTable.RowDeleting and DataTable.RowDeleted events) the delete is cancelled from the DataTable object nut not on the DataGrid object and the DataGrid object deletes the row from the view. Now I need to update my form by showing something else there and the changing back to the DataGrid view, then I can see again the previously deleted row. Is there any way to make the row stay on the DataGrid if the delete is cancelled? I already tried to update the DataGrid by populating it with new data in the DataTable.RowDeleted event but it raises this: An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.windows.forms.dll. What could I do?
Reply
Answers (
1
)
Stored Prodedure for inserting data from a XML file
Updating server database with data from client database using DataSet.Merge and DataAdapter.Update