IDataStore.RowDeleting Event
.NET Standard 2.x
Occurs when the deletion of row is about to begin.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
public event DwEventHandler<object, DwRowChangeEventArgs> RowDeleting;
Remarks
This event occurs when the Remove
, RemoveAt
or DeleteRow
method is called.
Examples
The following code example demonstrates that the RowDeleting
event is triggered when DeleteRow is being executed in the DataStore.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IDataStoreBaseExamples
{
public class RowDeletingExample
{
private SchoolContext _context;
public RowDeletingExample(SchoolContext dataContext)
{
// Sets the data context.
_context = dataContext;
}
public void Example()
{
// Instantiates datastore with datawindow: d_department.
var department = new DataStore("d_department", _context);
// Defines what to do when DeleteRow is being executed.
department.RowDeleting +=
(object sender, DwRowChangeEventArgs args) =>
{
Console.WriteLine("You are deleting a row!");
};
department.Retrieve();
// Deletes the first row.
department.DeleteRow(0);
/*This code produces the following output:
You are deleting a row!
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x