This is a migrated thread and some comments may be shown as answers.

Lock the another records in Edit

2 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rachel
Top achievements
Rank 1
rachel asked on 21 Sep 2010, 12:58 PM
Is there any way to lock the another records in edit? becouse the edited data are loss.
Also, the pager, the sort option, the insert button - Need to be disabled !

Why is there no somthing that do that automatically ?

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Sep 2010, 01:30 PM
Hello,


I guess you want to cancel the other operations in grid when it is in editmode. If so a better option would be showing confirm when trying to invoke any other operations, as shown below.

Attach OnCommand client event to RadGRid.
Client code:
<script type="text/javascript">
    function OnCommand(sender, args) {
        var commandName = args.get_commandName();
        if (sender._editIndexes.length > 0) {
            if (commandName != "Update") {
                if (commandName != "CancelUpdate") {
                    args.set_cancel(!confirm("You have not saved the data, do you want to continue...?"));
                }
            }
        }
    }
</script>



-Shinu.
0
rachel
Top achievements
Rank 1
answered on 21 Sep 2010, 02:44 PM
Exactly what I mean.
Thank you !
Tags
Grid
Asked by
rachel
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
rachel
Top achievements
Rank 1
Share this question
or