This is a migrated thread and some comments may be shown as answers.

unable to consume WCF restful service on kendoui grid

2 Answers 106 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Victoria
Top achievements
Rank 1
Victoria asked on 05 Oct 2012, 11:56 AM
Hi,

Some body please help 
Have created WCF Restful service. table name is Table1
and Servicename created is Table1CollectionService

Have ID and Name as table1 fields.

i am trying to bind this table info to a kendo grid.
i donno what for this is not working.

<script>
     $(document).ready(function () {
         $("#grid").kendoGrid({
             dataSource: {
                 type: "json",
                 transport: {
                     read: { url: "http://localhost:52408/Table1CollectionService.svc/", contentType: "application/json; charset=utf-8" }
                 },
                 schema: {
                     model: {
                         fields: { Id: { type: "number" }, Name: { type: "string" }
                         }} },
                 error: function (e) {
                     debugger;
                     alert('error');
                 },
                 change: function (e) {
                     alert("Change");
                 },
                 requestStart: function (e) {
                     debugger;
                     alert("Request Start");
                 },
                 pageSize: 10,
                 serverPaging: true,
                 serverFiltering: true,
                 serverSorting: true
             },
           filterable: true,
             sortable: true,
             pageable: true,


             columns: [{
                 field: "Id"
             }, { field: "Name" }
                        ]
         });
     });
    </script>

i have added jsonbehaviour attribute on service class also.
but it is not working .please help me if u can 

Thanks and Regards
Victoria

2 Answers, 1 is accepted

Sort by
0
Volodymyr
Top achievements
Rank 1
answered on 04 Nov 2012, 08:04 AM
There are some moments with working WCF to javascript.
At first you should declare your service in a special way.
At second make a right call to it from our js (in your js call you didn't specify a method). You can;t call a service by itself, you should specify an exact method you want to call.

To make it working together for the first time I spent about 8 hours. ))

I'll probably post you an example later on.
0
Victoria
Top achievements
Rank 1
answered on 05 Nov 2012, 04:54 AM
Thankyou for the reply Volodymyr,
But I solved this issue long back.
Thanks once agn.

Thanks and Regards
Victoria
Tags
Data Source
Asked by
Victoria
Top achievements
Rank 1
Answers by
Volodymyr
Top achievements
Rank 1
Victoria
Top achievements
Rank 1
Share this question
or