<EjsGrid DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" Height="315">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn HeaderText="Customer Name" EditType="EditType.DropDownEdit" Edit="@DropParams" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" EditType="EditType.DatePickerEdit" Format="yMd" TextAlign="TextAlign.Right" Width="130" Type="ColumnType.Date"></GridColumn>
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</EjsGrid>
@code{
public static List<Order> Orders { get; set; }
public static List<Countries> DDLData = new List<Countries>
{
new Countries() { Name = "Community", Code = "AU" },
new Countries() { Name = "Qualified", Code = "BM" },
new Countries() { Name = "Other", Code = "CA" },
};
public object DropParams = new
{
@@params = new DropDownListModel<string> { DataSource = DDLData, Query = "new ej.data.Query()",Fields= new FieldSettingsModel() { Text = "Name" ,Value="Name" } }
};
|
|
|