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

Webservice data binding example demo

1 Answer 64 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 26 Mar 2015, 02:57 PM
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


1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 31 Mar 2015, 03:03 PM
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.

 
Tags
Documentation and Tutorials
Asked by
Mark
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or