Webservice data binding example demo

2 posts, 0 answers
  1. Mark
    Mark avatar
    7 posts
    Member since:
    Dec 2014

    Posted 26 Mar 2015 Link to this post

    Folks:

    I have attempted to recreate the demo here: http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultcs.aspx. I have a blank and broken grid since this web method:
     public static List<Employee> GetData(int startIndex, int maximumRows,

    string sortExpressions, List<GridFilterExpression> filterExpressions)

    is not being called from this client script:
    PageMethods.GetData(0, tableView.get_pageSize(),

    tableView.get_sortExpressions().toString(), tableView.get_filterExpressions().toList(),

    updateGrid);

    Without this data the following client call is failing with a null error:

    function RadGrid1_RowDataBound(sender, args) {

    var radTextBox1 = args.get_item().findControl("LastName"); // find control

    radTextBox1.set_value(args.get_dataItem()["LastName"]); fails here

    }

    Can anyone please explain why the server side portion is not being called or provide a better example of client side data binding.

    Thanks in advance.

    Mark


  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 31 Mar 2015 Link to this post

    Hi,

    If you would like to implement RadGrid with client-side binding I would recommend you using RadClientDataSource. This control enables you to easily bind RadGrid to a WebService. In addition you can use CRUD operations. You can refer to the example below that illustrates how you can
    bind RadGrid on the client to a RadClientDataSource control:
    http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/client-data-source-binding/defaultcs.aspx

    Try using similar approach and you should be able to implement the functionality you are looking for.

    Regards,
    Pavlina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top