Failure to Post trap

PlatinumGrid - Full version
Post Reply
Dmilpsu
Posts: 28
Joined: Sun Apr 17, 2016 7:14 pm

Failure to Post trap

Post by Dmilpsu » Tue Aug 02, 2016 3:35 pm

Using the Inline or form method, a user can alter data in a row and then intentionally or accidentally move to another row and lose the edits that were made. Is it possible to trap this situation and if data was edited give user the option to discard the data or Save it before moving to the next record.

jomitech
Site Admin
Posts: 1964
Joined: Wed Oct 08, 2008 12:23 am

Re: Failure to Post trap

Post by jomitech » Mon Aug 15, 2016 11:33 pm

Use the OnRowEditing JavaScript event to cancel an edit operation on a row if the grid is already in edit mode.
Jon

Dmilpsu
Posts: 28
Joined: Sun Apr 17, 2016 7:14 pm

Re: Failure to Post trap

Post by Dmilpsu » Fri Aug 19, 2016 2:59 pm

How do I test for edit mode for a grid or do I need to look at the dataset?

jomitech
Site Admin
Posts: 1964
Joined: Wed Oct 08, 2008 12:23 am

Re: Failure to Post trap

Post by jomitech » Sat Aug 20, 2016 10:45 am

Check the grid's EditingRow property. If it's > -1, then the grid is in edit mode. For example:

Code: Select all

if (grid.EditingRow > -1) {
    return false;
}
Jon

Dmilpsu
Posts: 28
Joined: Sun Apr 17, 2016 7:14 pm

Re: Failure to Post trap

Post by Dmilpsu » Tue Aug 23, 2016 9:06 am

worked great, thanks

Post Reply