<script type=
"text/javascript"
>
$(
function
() {
// get a reference to the grid
var
grid = $(
"#@gridname"
).data(
"kendoGrid"
);
grid.bind(
"edit"
,
function
(e) {
e.container.find(
"input"
).select();
});
});
</script>
@{Html.Kendo().Grid((List<BNYM.EnSIS.Pricing.Contract.VendorPricingGridResponse>)ViewData["PricingGrid"])
.Name("PricingGrid")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(25)
.Batch(true)
.ServerOperation(true)
.Model(q => q.Id(m => m.ProductID))
.Model(q => q.Id(m => m.CurrencyCode))
)
.Columns(columns =>
{
columns.Bound(m => m.Category).Title("Category").Width(90);
columns.Bound(m => m.ProductID).Title("ProductID").Width(140);
columns.Bound(m => m.CurrencyCode).Title("USD").Width(50);
})
.Resizable(resizing => resizing.Columns(true))
.Scrollable(scrolling => scrolling.Enabled(true).Height(600))
.Sortable(sorting => sorting.Enabled(true))
.Groupable(grouping => grouping.Enabled(true))
.Filterable(filtering => filtering.Enabled(true))
.Reorderable(reorder => reorder.Columns(true))
.Pageable(Pageable => Pageable.Enabled(true).PreviousNext(true).Input(true).PageSizes(true).Refresh(true))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.ProductID))
.RowAction(row => row.HtmlAttributes.Add("data-id", row.DataItem.CurrencyCode))
.Selectable(s => s.Mode(GridSelectionMode.Single).Enabled(true))
.Render();
}