@{
List<object> commands = new List<object>();
commands.Add(new { type = "Edit", buttonOption = new { iconCss = "e-icons e-edit", cssClass = "e-flat" } });
commands.Add(new { type = "Delete", buttonOption = new { iconCss = "e-icons e-delete", cssClass = "e-flat" } });
commands.Add(new { type = "Save", buttonOption = new { iconCss = "e-icons e-update", cssClass = "e-flat" } });
commands.Add(new { type = "Cancel", buttonOption = new { iconCss = "e-icons e-cancel-icon", cssClass = "e-flat" } });
}
<ejs-grid id="Grid" load="onLoad" allowPaging="true" frozenRows="0" allowSorting="true" allowFiltering="true" allowpaging="true" actionComplete="actionComplete" toolbar="@( new List<object>() {"Add","Edit","Delete","Update","Cancel", "Search"})">
. . . . .
<e-data-manager url="/Index?handler=DataSource" insertUrl="/Index?handler=Insert" removeUrl="/Index?handler=Delete" updateUrl="/Index?handler=Update" adaptor="UrlAdaptor"></e-data-manager> // have to define server side method name as /index?handler= Name
<e-grid-columns>
<e-grid-column headerText="Manage Records" width="150" commands="commands"></e-grid-column>
. . . . . .
<e-grid-column field="OrderDate" headerText="Order Date" customFormat="@(new { type ="dateTime", format="MM/dd/yyyy hh:mm:ss a" })" width="170"></e-grid-column>
<e-grid-column field="CustomerName" headerText="CustomerName" textAlign="Right" width="120"></e-grid-column>
<e-grid-column field="City" headerText="City" width="150"></e-grid-column>
</e-grid-columns>
</ejs-grid> |
public JsonResult OnPostDataSource([FromBody]DataManagerRequest dm)
{
. . . .
} |