I want the grid to be responsive just like this page (https://demos.telerik.com/aspnet-mvc/grid), but I don't see any sample code that make it works.
Here is my code:
@{
Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Bound(request => request.Id).Filterable(ftb => ftb.Cell(cell => cell.Template("integerFilter").Operator("eq").ShowOperators(false)));
columns.Bound(request => request.Requestor).Encoded(false);
columns.Bound(request => request.RequestDate).Format("{0:MM/dd/yyyy}").Encoded(false).HeaderHtmlAttributes(new { @class = "hidden - xs" }).HtmlAttributes(new { @class = "hidden - xs" });;
columns.Bound(request => request.ChangeStartDateTime).Format("{0: M/d/yyyy h:mm tt}").Encoded(false).HeaderHtmlAttributes(new { @class = "hidden - xs" }).HtmlAttributes(new { @class = "hidden - xs" });
columns.Bound(request => request.ChangeEndDateTime).Format("{0: M/d/yyyy h:mm tt}").Encoded(false).HeaderHtmlAttributes(new { @class = "hidden - xs" }).HtmlAttributes(new { @class = "hidden - xs" });
columns.Bound(request => request.RequestSubject).Encoded(false).HeaderHtmlAttributes(new { @class = "hidden - xs" }).HtmlAttributes(new { @class = "hidden - xs" });
columns.Bound(request => request.CurrentStatus).Encoded(false);
columns.Bound(request => request.CompletedFlag).Encoded(false);
})
.Filterable(filterable => filterable
.Extra(false)
.Operators(operators => operators
.ForString(str => str.Clear()
.Contains("Contains")
.StartsWith("Starts With "))
.ForNumber(num => num.Clear()
.IsEqualTo("Equal to"))
.ForDate(d => d.Clear())
)
.Mode(GridFilterMode.Row))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.Resizable(resize => resize.Columns(true))
.Selectable()
.Sortable()
.DataSource(dataSource => dataSource
.Server()
.Model(model => model.Id(request => request.Id))
)
.Render();
}
<script>
function integerFilter(e) {
e.element.kendoNumericTextBox({
spinners: false,
format: "#",
decimals: 0
});
};
$(function() {
$("div.k-grid-content").find("col").addClass("hidden-xs");
$("div.k-grid-header").find("col").addClass("hidden-xs");
});
</script>
Please see attached image. I would like to show all columns from desktop but should be able to hide some columns from smart devices. How can I accomplish the followings?
1) Responsive Grid
2) Freeze curtain grid columns
Thank you very much in advance!
Anieda