or
<!DOCTYPE html><html><head> <base href="http://demos.telerik.com/kendo-ui/grid/index"> <style>html { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }</style> <title></title> <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.common.min.css" /> <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.default.min.css" /> <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.dataviz.min.css" /> <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.3.1119/styles/kendo.dataviz.default.min.css" /> <script src="http://cdn.kendostatic.com/2014.3.1119/js/jquery.min.js"></script> <script src="http://cdn.kendostatic.com/2014.3.1119/js/kendo.all.min.js"></script></head><body> <div id="example"> <div id="grid"></div> <script> $(document).ready(function () { $("#grid").kendoGrid({ dataSource: { type: "odata", transport: { }, pageSize: 5, group: { field: "ContactName" }, }, pageable: { refresh: true, pageSizes: true, buttonCount: 5 }, columns: [{ field: "ContactName", title: "Contact Name", width: 400 }, { field: "ContactTitle", title: "Contact Title", width: 400 }, { field: "CompanyName", title: "Company Name", width: 400 }, { field: "Country", width: 400 }] }); }); </script> </div></body></html>griddatasource= new kendo.data.DataSource({ transport: { read: function (option) { $.ajax({ url: 'http://localhost:53788/ReportKendo.svc/getGrid', dataType: 'json', success: function (data) { option.success(JSON.parse(data.d)); }, error: function (doc) { alert("Grid load Error") } }); } }, serverPaging: true, pageSize: 15, schema: { model: { fields: { serialnumber: { type: "string" }, jobcode: { type: "string" }, mname: { type: "string" }, vouchertype: { type: "string" }, dummyvouno: { type: "string" }, dummyvoudate: { type: "string" }, voucherno: { type: "string" }, voucherdate: { type: "string" }, Createdby: { type: "string" }, amount: { type: "string" }, currencycode: { type: "string" }, trncurrency: { type: "string" }, ispaid: { type: "string" }, isiuv: { type: "string" }, isreverse: { type: "string" }, isprovisionalvoucher: { type: "string" }, voucherstatus: { type: "string" }, subcode: { type: "string" }, credate: { type: "string" }, aurthtime: { type: "string" }, billno: { type: "string" }, billdate: { type: "string" }, subledgername: { type: "string" } } } } });$("#grid").kendoGrid({ dataSource: griddatasource, serverPaging: true, groupable: true, sortable: true, selectable:true, filterable: true, reorderable: true, resizable: true, columnMenu: true, pageable: { refresh: true, pageSizes: true }, detailInit: subgrid, aggregate: [{ field: "amount", aggregate: "sum" }], columns: [{ field: "jobcode", width: 120, title: "Job Code" }, { field: "mname", width: 300, title: "Job Name" }, { field: "vouchertype", width: 120, title: "Voucher Type", }, { field: "dummyvouno", width: 130, title: "Ref Voucher No.", }, { field: "dummyvoudate", width: 150, title: "Ref Voucher Date", }, { field: "voucherno", width: 120, title: "Voucher No.", }, { field: "voucherdate", width: 120, title: "Voucher Date", }, { field: "Createdby", width: 150, title: "Created By", }, { field: "amount", width: 100, title: "Amount", FooterTemplate: "Amount: #= sum #", }, { field: "currencycode", width: 120, title: "Job Currency", }, { field: "trncurrency", width: 120, title: "Trans Currency", }, { field: "ispaid", width: 130, title: "Is Paid/Received", }, { field: "isiuv", width: 90, title: "Is IUV", }, { field: "isreverse", width: 100, title: "Reversed", }, { field: "isprovisionalvoucher", width: 165, title: "Is Provisional Voucher", }, { field: "voucherstatus", width: 100, title: "Status", }, { field: "subcode", title: "Narration", width: 270 }, { field: "credate", title: "Created Date", width: 110 }, { field: "aurthtime", title: "Authorised Date", width: 130 }, { field: "billno", title: "Bill No.", width: 90 }, { field: "billdate", title: "Bill Date", width: 110 }, { field: "subledgername", title: "Subledger Name", width: 200 } ] }); public object getGrid(){
str = "select serialnumber,jobcode,mname,vouchertype,dummyvouno,CONVERT(varchar,cast(dummyvoudate as date),105) as dummyvoudate ,voucherno,CONVERT(varchar,cast(voucherdate as date),105) as voucherdate,Createdby,amount,currencycode,trncurrency,ispaid,isiuv,isreverse,isprovisionalvoucher,voucherstatus,jobcode+' '+CONVERT(VARCHAR(23),trandate, 121) as subcode,CONVERT(varchar,cast(credate as date),105) as credate,CONVERT(varchar,cast(authtime as date),105) as aurthtime,billno,CONVERT(varchar,cast(billdate as date),105) as billdate,subledgername from vinfohvoucherview";
ds = obj.WsQGetRecSet(str, "vmacmvouchercontrol", ref errormsg, registry);
return JsonConvert.SerializeObject(ds.Tables[0]);
}