Version

RowsDeleting Property

Event fired before a row is deleted.

This event is cancelable.

Syntax
'Declaration
 
Public Property RowsDeleting As String
public string RowsDeleting {get; set;}
Example
Me.WebDataGrid1.Behaviors.EditingCore.EditingClientEvents.RowsDeleting = "WDG1_RowDeleting"
Me.WebDataGrid1.Behaviors.EditingCore.EditingClientEvents.RowDeleted = "WDG1_RowDeleted"
this.WebDataGrid1.Behaviors.EditingCore.EditingClientEvents.RowsDeleting = "WDG1_RowDeleting";
this.WebDataGrid1.Behaviors.EditingCore.EditingClientEvents.RowDeleted = "WDG1_RowDeleted";
// The client event RowDeleting takes two parameters sender and e
// sender  is the object which is raising the event
// e is the CancelRowsDeletingEventArgs

var length = null;  
function WDG1_RowDeleting(sender, e) {

    //Returns the collection of rows that are about to be deleted
    var rows = e.get_rows();

    //Returns the number of rows in the collection
    length = rows.get_length();

    if (length == 1) {

        if (!confirm("Are you sure you want to delete the row?"))

        //Cancels 'RowDeleting' event
            e.set_cancel(true);

    }
    else {
        if (!confirm("Are you sure you want to delete the '" + length + "' rows?"))

            e.set_cancel(true);
    }

}

       
// The client event RowDeleted takes two parameters sender and e
// sender  is the object which is raising the event
// e is the RowsDeletedEventArgs
function WDG1_RowDeleted(sender, e) {

    var wdg = $find("WebDataGrid1");

    //Returns the grid's behavior collection
    var behaviors = wdg.get_behaviors();

    //Returns reference to the selection behavior
    var selection = behaviors.get_selection();

    if (length == 1) {
        alert("Successfully deleted the row!");
    } else
        alert("Successfully deleted the rows!");
        
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also