Hi I am using the grid in asp.net core 2.1 excellent product by the way however i am having an issue its the inline popup is display more fields than i have defined in my grid layout for example
In my grid I would be expecting just the five columns here but its displaying the entire model in the popup. Also how does one use dapper for the crud operations is that possible as I am using stored procs to keep my site fast and clean to acehieve this.
Also how do i color the command buttons is that simple enough?
columns.Bound(p => p.Name).Filterable(false);
columns.Bound(p => p.Description);
columns.Bound(p => p.ActivityDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.EmployeeName);
columns.Bound(p => p.Status);
@(Html.Kendo().Grid<
FuelActivityTrackerDal.Models.ActivityHeader
>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.Name).Filterable(false);
columns.Bound(p => p.Description);
columns.Bound(p => p.ActivityDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.EmployeeName);
columns.Bound(p => p.Status);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp))
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(Model.Count())
.Read(read => read.Action("Activity_Read", "Activity"))
)
)
<
script
type
=
"text/javascript"
>
function error_handler(e) {
if (e.errors) {
var message = "Errors:\n";
$.each(e.errors, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
alert(message);
}
}
</
script
>