Force Gridview Edit to complete before leaving control

Posted on 2007-10-05
Last Modified: 2013-11-26
I have a gridview that allows users to Edit the rows. On top of the gridview, I have a formview I use for data entry inserts. Problem I find is that new users click on the gridview Edit, make the change and don't click the UPDATE or CANCEL option. They then select the formview Insert link and the Insert form loads, with the gridvew record still in edit mode under the formview.

I would like a way to force the user to either Update or Cancel the edit before they move off the griview control. Is that possible?
Question by:Thirt
    LVL 11

    Expert Comment

    Could you disable the Insert button on clicking the Edit button and then re-enable it again on the click of the Cancel or Update?
    LVL 4

    Author Comment

    Well, that would require referncing the Formview Insertitem template controls...which I think is possible but not friendly. But there is also a dropdown I use above the gridview as a filter for the gridview results. I would need to disable that as well? I have a link to another form.... I guess that's my only option.
    LVL 11

    Accepted Solution

    When you click the insert button, you could iterate through the grid to check the status of each of the rows to see if any are in update mode. You could place this in a method and call that before you apply the filter also. Should there be any row being updated, you could exit the sub and warn the user that there is a record still being edited.
    LVL 4

    Author Comment

    Hmmm, I think I actually understand what you said. Let me see how far I get before I run into a brick wall.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    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…

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now