DataGrid row deletes even when DataTable row delete is cancelled.

Posted on 2006-04-08
Last Modified: 2008-02-01
I finally managed to figure out how to abort the deletion of a row in a datatable that is bound to a datagrid. Now the problem is that the last row of the grid goes away. If I click the column header to sort the column, the row reappears.
I have found other people with the same problems but no solution yet.
Question by:seinc
    1 Comment
    LVL 2

    Accepted Solution

    Hello seinc ,
           I do know that this is a common problem. But there are some tacky solutions to it.

         First of all when you rollback or abort the deletion procedure. After doing that just refresh the datagrid. It should work for you.

    the datatable row can be compare for row.rowstate = modified.

    if modified refresh the datagrid so that there is no loss in the last row.


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    734 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

    23 Experts available now in Live!

    Get 1:1 Help Now