or
@{Html.Telerik().Grid(Model)
.Name("grdAllUsers")
.DataKeys(keys => keys.Add(k =>
k.Id)
)
.Columns(columns =>
{
columns.Bound(o => o.FirstName)
.Width(150);
columns.Bound(o => o.LastName)
.Width(150);
columns.Bound(o => o.EmailAddress)
.Width(200);
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image);
commands.Delete().ButtonType(GridButtonType.Image);
})
.Width(70)
.HtmlAttributes(new { style = "text-align:center" });
})
.NoRecordsTemplate(@<
text
>No User records to display.</
text
>)
.Pageable(paging =>
paging.PageSize(15)
)
.Sortable()
.Filterable()
.Render();
}
@{Html.Kendo().Grid(Model
)
.Name("grdAllUsers")
.Columns(columns =>
{
columns.Bound(o => o.FirstName)
.Width(150);
columns.Bound(o => o.LastName)
.Width(150);
columns.Bound(o => o.EmailAddress)
.Width(200);
columns.Command(commands =>
{
commands.Edit().ButtonType(???);
commands.Delete().ButtonType(???);
})
.Width(70)
.HtmlAttributes(new { style = "text-align:center" });
})
.Pageable(paging =>
paging.PageSize(15)
)
.Sortable()
.Filterable()
.Render();
}
columns.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.Image);
commands.Delete().ButtonType(GridButtonType.Image);
})
$(document).on('click', '.myClass', function () {....
$('.myClass'.kendoDropTarget({ drop: function (e) { ... } });
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type = "text/javascript"> // this is the structure of the data comes from server function Employee(Name, Age) { this.Name = Name; this.Age = Age; } $(document).ready(function () { var em1 = new Employee("Daljit", 23); var em2 = new Employee("Manjit", 20); var em3 = new Employee("Joga", 25); var Department = { Name: "Question Name", Employees: new Array(em1, em2, em3) }; var departmentVM = kendo.observable ( Department ); var templateContent = $("#myTemplate").html(); var template = kendo.template(templateContent); $("#daljitControls").append(template(departmentVM.Employees)); kendo.bind($("#daljitControls"), departmentVM); }); </script> </head> <body> <div id = "daljitControls"> <input type="text" data-bind="value:Name" class="k-textbox" name="Name" /> </div> <script type="text/x-kendo-template" id="myTemplate"> # for (var i = 0; i < data.length; i++) { # # var employee = data[i]; # <input data-bind="value: employee.Name" class="k-textbox"/> # } # </script> </body> </html>
@{
var settings = new MySettings(); //containing .Pageable() .Sortable() etc
settings .Name("KendoGrid")
settings .Columns(columns =>
{
columns.Bound(p => p.Description);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.ToolBar(commands => commands.Create())
)
}
@Html.Kendo().Grid(settings).BindTo(Model).Render();
GridData =
new
kendo.data.DataSource({
transport: {
read: {
url: buildAsyncUrl(
'GetData'
),
dataType:
"json"
,
data: JSON.stringify(GridFilters)
}
},
......
});
function
buildAsyncUrl(cont) {
return
cont +
'/?nocache='
+ Math.random();
}
//whenever we need to refresh the grid we call:
GridData.read();
0.36012812319771115
0.5465367197402407
0.5722005265817256