or
'limit here is taking the page numberr Dim JSON_result As String = "[" 'get the data from DB and make it a JSON string Dim connection1 As New MySqlConnection(constr) connection1.Open() Dim get_Command As New MySqlCommand(get_data, connection1) Dim reader As MySqlDataReader = get_Command.ExecuteReader() While reader.Read() Dim FirstName As String = reader("fname").ToString() Dim LastName As String = reader("lname").ToString() Dim address As String = reader("address").ToString() Dim phnum As String = reader("phnum").ToString() JSON_result += "{""First Name"":""" & FirstName & """, ""Last Name"":""" & LastName& """, ""Address"":""" & address & """, ""contact"":""" & phnum& """}," End While JSON_result = JSON_result.Remove(JSON_result.Length - 1) JSON_result += "]"var grid = $("#gridAllRuns").kendoGrid({ dataSource: { type: "json", transport: { read: url_load }, schema: { total: function (response) { return 43658; } }, serverPaging: true, pageSize: 2000 }, dataBound: onDataBound, height: $(document).height() - 250, groupable: true, sortable:true, reorderable: true, //selectable: "multiple", resizable: true, pageable: true, filterable: { extra: false, operators: { string: { eq: "equal to", startswith: "starts with", neq: "not equal to" } } }, toolbar: kendo.template($("#template").html()), columns: [ { title: "First name", field: "First Name"}, { title: "Last name", field: "Last Name" }, { title: "Address", field: "Address" }] }
//create AutoComplete UI component $("#State").kendoAutoComplete({ dataTextField: "text", dataValueField: "value", open: function (e) { valid = false; }, select: function (e) { valid = true; }, close: function (e) { // if no valid selection - clear input if (!valid) this.value(''); }, dataSource: autoCompleteStates, placeholder: "Select States..." });@(Html.Kendo().Grid<InventarioMerlin.Models.ContadorModelo>() .Name("GridContadorModelo") .Columns(columns => { columns.Bound(p => p.id).Visible(false).Width(100); columns.Bound(p => p.nombre).Width(100); columns.Bound(p => p.isenabled).Width(100); columns.Bound(p => p.img).Width(100); columns.Command(c => c.Custom("Upload").Click("upload")).Title("Grafica").Width(100); columns.Bound(p => p.grafica).Width(100); columns.Command(command => { command.Edit(); }).Width(200); }) .ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); }) .Editable(editable => editable.Mode(GridEditMode.InCell)) .Pageable(p => p.Refresh(true)) .Sortable() .Scrollable() .HtmlAttributes(new { style = "height:100%;" }) .DataSource(dataSource => dataSource .Ajax() .PageSize(20) .Events(events => events .Error("error_handler") .RequestEnd("onRequestEnd")) .Model(model => { model.Field(p => p.img).Editable(true); model.Id(p => p.id); model.Field(p => p.id).Editable(false); model.Field(p => p.isenabled).DefaultValue(true); }) .Create(create => create.Action("ContadorModelo_Popup_Create", "Contador")) .Read(read => read.Action("ContadorModelo_Popup_Read", "Contador")) .Update(update => update.Action("ContadorModelo_Popup_Update", "Contador")) //.Destroy(update => update.Action("EditingPopup_Destroy", "Ccoconfiguraciones")) ) )function upload(e) { e.preventDefault(); rowSelected = this.dataItem($(e.currentTarget).closest("tr")); $('#myModal').modal({ show: true }) } $("#btnSaveChanges").click(function () { refreshGrid(); $('#myModal').modal('hide'); });function refreshGrid() { var grid = $("#GridContadorModelo").data("kendoGrid"); var dataSource = grid.dataSource; var data = dataSource.data(); $.each(data, function (index, rowItem) { if (rowItem.id == rowSelected.id) { rowItem.img = imageUploaded; rowSelected.dirty = true; } }); grid.refresh(); }