@using System.ComponentModel.DataAnnotations;
<SfGrid DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" Height="315">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal"></GridEditSettings>
<GridEvents OnActionBegin="ActionBeginHandler" OnActionComplete="ActionCompletedHandler" TValue="Order"></GridEvents>
</SfGrid>
@code{
public List<Order> Orders { get; set; }
. .
public void ActionBeginHandler(ActionEventArgs<Order> args)
{
// Here you can customize your code
}
public void ActionCompletedHandler(ActionEventArgs<Order> args)
{
// Here you can customize your code
}
public class Order
{
[Key]
public int? OrderID { get; set; }
public string CustomerID { get; set; }
public DateTime? OrderDate { get; set; }
public double? Freight { get; set; }
public string ShipCountry { get; set; }
}
}
|