unable to consume WCF restful service on kendoui grid

3 posts, 0 answers
  1. Victoria
    Victoria avatar
    6 posts
    Member since:
    Oct 2012

    Posted 05 Oct 2012 Link to this post

    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. Volodymyr
    Volodymyr avatar
    11 posts
    Member since:
    May 2012

    Posted 04 Nov 2012 Link to this post

    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.
  3. Victoria
    Victoria avatar
    6 posts
    Member since:
    Oct 2012

    Posted 04 Nov 2012 Link to this post

    Thankyou for the reply Volodymyr,
    But I solved this issue long back.
    Thanks once agn.

    Thanks and Regards
    Victoria
Back to Top